shell小程序的问题。
发表于 : 2006-12-16 18:28
#!/bin/sh
echo "What is your favourite OS?"
select var in "Linux" "Gnu Hurd" "Free BSD" "Other"; do
break
done
echo "You have selected $var"
保存为hello
执行./hello结果出现如下问题。
What is your favourite OS?
./hello: 3: select: not found
./hello: 4: break: not found
./hello: 5: Syntax error: "done" unexpected
谁能帮我解释一下?
echo "What is your favourite OS?"
select var in "Linux" "Gnu Hurd" "Free BSD" "Other"; do
break
done
echo "You have selected $var"
保存为hello
执行./hello结果出现如下问题。
What is your favourite OS?
./hello: 3: select: not found
./hello: 4: break: not found
./hello: 5: Syntax error: "done" unexpected
谁能帮我解释一下?