我的bash坏了吗?
发表于 : 2008-11-10 13:35
我运行这个简单的脚本可是为什么总是报错呢下面是这个简单的脚本和报误
这个脚本是我按照教程上抄的他的就可以执行而我的。。。。。。then expected

这个脚本是我按照教程上抄的他的就可以执行而我的。。。。。。then expected

代码: 全选
#!/bin/sh
if [ $# -ne 1 ];
then echo "Usage: $0 username";
exit 1;
else
echo "hello world, hello $1";
fi
我加了空格可还是有个报错结果,好像是then后面的有错。。。sschenri 写了:#!/bin/sh
if [ $# -ne 1 ];
then echo "Usage: $0 username";
exit 1;
else
echo "hello world, hello $1";
fi
少了空格
[和]??alinmn 写了:[ 和 ] 前后各有一个空格