Linux---shell 基本操作符及常见符号

基本操作符

-s:  Check if file has size greater than 0 if yes then condition becomes true.  
实际应用中,[ -s $file ]  如果$file内容不为空,或者file其实是个folder的话,都返回true


ksh -n
-n      Read commands and check them for syntax errors, but do not execute them.   Ignored  for
                      interactive shells.
会检查语法中的错误,比如文件中引号是否成对出现等

 -h file

              True, if file exists and is a symbolic link.如果文件存在并且是是个符号链接。返回true。

 -d file
              True, if file exists and is a directory. 文件存在并且是目录,返回true


常见符号

$$ 记录脚本运行是的pid,进程号


           

     

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值