回忆之城
生命在于折腾
posts - 575,comments - 9,trackbacks - 0

今天写了个shell脚本一运行就出现"binary operator expected"错误

test1.sh: line 6: [: /export/images/a10091400ux0415: binary operator expected

检查脚本第六行:

if [ ! -f /export/images/$line ];then

上网查了一下,加上双引号,就可以了

将 if [ ! -f /export/images/$line ];then 改为

if [ ! -f "/export/images/$line" ];then

问题解决.

posted on 2014-04-28 13:00 回忆之城 阅读(10725) 评论(0)  编辑 收藏 引用 所属分类: unix/linux
只有注册用户登录后才能发表评论。