庆典:在if语句多一元运算符 [英] bash : Multiple Unary operators in if statement

查看:141
本文介绍了庆典:在if语句多一元运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能有多个一元运算符在if语句..这里是code片断这是给我的错误。

请在这里更正code。

 如果[-f $ INPUT_FILE] -a [-f $ OUTPUT_FILE] -a [-f $ LOG_FILE]
然后
这里有### code
科幻

谢谢
基兰


解决方案

 如果[-f文件1-a -f文件2-a文件3];然后
   #some code
科幻

Is it possible to have multiple unary operators in if statements.. Here is the code snippet which is giving me error.

Please correct the code here.

if [ -f $input_file ] -a [ -f $output_file ] -a [ -f $log_file ] ]
then
### Some Code here
fi

Thanks Kiran

解决方案

if [ -f "file1" -a -f "file2" -a "file3" ]; then
   #some code
fi

这篇关于庆典:在if语句多一元运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆