shell练习题(1)

练习:

1.建立脚本service.sh,当执行的时候要求输入(1、2、3、4、5)时安装对应的httpd、vim、wget、更换aliyum等功能,当输入错误 时会提示你,应该输入正确的值
[root@bogon yy]# cat service.sh 
#!/bin/bash
cat <<-EOF 
+-------------------------------------------------------------------------+ 
|                             System_tools V1.0                           | 
+-------------------------------------------------------------------------+
|                     1. 更换阿里源.                                      |
|                     2. 安装http.                                        |
|                     3. 安装vim.                                         |
|                     4. 安装wget.                                        |
|                     5. exit.                                            |     
+-------------------------------------------------------------------------+ 
EOF
read -p "请输入你的选项:" cce
case $cce in
        1)
        

你可能感兴趣的:(shell,linux)