初学shell 懵懂
发表于 : 2008-04-07 16:48
#!/bin/sh
salutation="Hello"
echo $salutation
echo "The program $0 is now running"
echo "The second parameter was $2"
echo "The first parameter was $1"
echo "The parameter list was $*"
echo "The user's home directory is $HOME"
echo "Please enter a new greeting"
read salutation
echo $salutation
echo "The script is now complete"
exit 0
我的shell源文件如上
执行时为什么有这样的提示,执行起来也是对的啊,为什么会出现:not found 之类的语句呢? 不明白...
lucky@lucky-desktop:~/linux程序设计/chapter02$ /bin/sh try_var
: not found
Hello
The program try_var is now running
The second parameter was
The first parameter was
The parameter list was
The user's home directory is /home/lucky
: not found:
Please enter a new greeting
Sire
: bad variable namen
: not found:
Hello
The script is now complete
: not found:
exit: 17: Illegal number: 0
salutation="Hello"
echo $salutation
echo "The program $0 is now running"
echo "The second parameter was $2"
echo "The first parameter was $1"
echo "The parameter list was $*"
echo "The user's home directory is $HOME"
echo "Please enter a new greeting"
read salutation
echo $salutation
echo "The script is now complete"
exit 0
我的shell源文件如上
执行时为什么有这样的提示,执行起来也是对的啊,为什么会出现:not found 之类的语句呢? 不明白...
lucky@lucky-desktop:~/linux程序设计/chapter02$ /bin/sh try_var
: not found
Hello
The program try_var is now running
The second parameter was
The first parameter was
The parameter list was
The user's home directory is /home/lucky
: not found:
Please enter a new greeting
Sire
: bad variable namen
: not found:
Hello
The script is now complete
: not found:
exit: 17: Illegal number: 0