LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 569|回复: 4

一个脚本 大家看看错在那了

[复制链接]
发表于 2004-8-31 08:43:18 | 显示全部楼层 |阅读模式
=====================================代码开始
#!/bin/bash
# name:iftest
# this is a comment line, all comment lines start with a #

if ["10" -lt "12"]
        then
        # yes 10 is lell than 12
        echo "Yes,10 is less than 12"
fi
=====================================代码结束

===============执行结果==============
./if: line 5: [10: command not found
=====================================
我不知道第5行怎么错了  请大哥指教

小弟先谢了!
发表于 2004-8-31 09:55:09 | 显示全部楼层
[后和]前放空格
 楼主| 发表于 2004-8-31 10:05:59 | 显示全部楼层
谢谢   如你所言  问题解决
发表于 2004-8-31 10:11:00 | 显示全部楼层
if [ “10" -lt "12"]
是不是if 10 less than 12 的意思
发表于 2004-8-31 11:41:39 | 显示全部楼层
最初由 冰封尘 发表
if [ “10" -lt "12"]
是不是if 10 less than 12 的意思

是的,更多的shell知识,请查阅:
http://www.linuxsir.cn/bbs/showthread.php?threadid=28945
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表