分页: 1 / 1

Shell if问题

发表于 : 2008-05-14 9:21
teapot
29 if["$UID" -ne "$ROOT_UID"]
30 then
31 echo "Must be root to run this script."
32 exit $E_NOTROOT
33 fi


这句怎么会错呢?

./Cleanup.3.sh: line 29: if[1000 -ne 0]:找不到命令
./Cleanup.3.sh: line 30: 在未预料的“then”附近出现语法错误
./Cleanup.3.sh: line 30: `then'

发表于 : 2008-05-14 9:45
xiooli
if [ "$UID" -ne "$ROOT_UID" ]
空格滴重要!

发表于 : 2008-05-14 12:21
teapot
明白了!