自己买了一本shell的书,按照他的样子,自己试了一下,结果是错了
#!/bin/sh
echo "hello"
read "an"
if [ "an"=y -o "an"=Y ]
than
echo "are"
else
echo "1234"
fi
他说是第7行附近有语法错误。书上都是这样写的。我只不过是改了几过单词。哪位高手赐教一次
新手来了
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 新手来了
1. http://bash.cyberciti.biz/guide/If..else..fithan
如果是 #!/bin/bash
than 應該改為 then
2. http://www.dreamsyssoft.com/unix-shell- ... torial.php
如果是 #!/bin/sh
than 應該刪除