使用shell的if else fi语句和注意的地方
来源:互联网 发布:中国著名网络作家列传 编辑:程序博客网 时间:2024/06/07 05:31
用一个需要用户回答的做例子
echo "delete mnt_ramdisk's files(y/n)?"
read key_value
if [ "${key_value}" = "y" ]; then
cd mnt_ramdisk
ls | grep -v lost+found | xargs rm -rf
echo $PWD
cd ..
echo $PWD
else
echo "not delete!"
fi
注意:中括号[ 和 ]的前后都需要空格,这个搞得我郁闷了很长时间。
- 使用shell的if else fi语句和注意的地方
- shell的if else 语句
- if else语句的使用
- shell script 学习(四)条件判断式的使用:if..then ..fi和 case...esac语句
- linux shell ---if...else...fi
- if else if else 语句的拓展
- if和else if的使用注意事项
- if..else 语句的简单使用
- Shell if else语句
- Shell if else语句
- Shell if else语句
- Shell if else语句
- Shell if else语句
- Shell if else语句
- Shell if else语句
- linux shell 编程 3(if then else fi 字符串空的判断)
- if......if和if......else if......else if的区别
- 存储过程中,goto语句和if else语句注意,标签的位置问题导致条件语句失效
- 国际化开发技术FAQ
- System.Data.SqlClient.SqlException: 必须声明变量 '@ImageUrl'。
- NS4=(document.layers)? 1:0;
- C# 获取RICHTEXTBOX所有图形的位置和大小
- c#实现的媒体播放类,支持mp3/wma/wmv/flash/rm
- 使用shell的if else fi语句和注意的地方
- 对js中startWith和endWith的扩展
- 对比下吃过的几种挂面
- 用Ant 打包java工程为jar文件
- mysql优化技巧
- hibernate多表查询
- 动态表格 添加行 删除行 删除列
- vsFTPd-Linux网络安装与配置FTP服务器及Redhat局域网安装的解决办法
- UltraEdit/UEstudio的使用技巧(我是根据UEStudio9设置)