当前位置: 技术问答>linux和unix
这个shell脚本在ksh环境中不能执行么、、、??
来源: 互联网 发布时间:2017-03-30
本文导语: #!/bin/sh #要求用户输入数值,然后打印出该数值,直到用户输入"end"后才停止 #vi show_var.sh unset var echo "please input a number:" read var while["$var" != "end"] do echo "please input a number again:" read va...
#!/bin/sh
#要求用户输入数值,然后打印出该数值,直到用户输入"end"后才停止
#vi show_var.sh
unset var
echo "please input a number:"
read var
while["$var" != "end"]
do
echo "please input a number again:"
read var
if["$var" = "end"]
then
break
fi
echo "var is : $var"
done
#要求用户输入数值,然后打印出该数值,直到用户输入"end"后才停止
#vi show_var.sh
unset var
echo "please input a number:"
read var
while["$var" != "end"]
do
echo "please input a number again:"
read var
if["$var" = "end"]
then
break
fi
echo "var is : $var"
done
|
#!/bin/ksh
#要求用户输入数值,然后打印出该数值,直到用户输入"end"后才停止
#vi show_var.sh
unset var
echo "please input a number:"
read var
while[ "$var" != "end" ]
do
echo "please input a number again:"
read var
if[ "$var" = "end" ]
then
break
fi
echo "var is : $var"
done
|
while["$var" != "end"]和if["$var" = "end"]
请用空格将每个单元隔开!
while [ "$var" != "end" ]
if [ "$var" = "end ]
请用空格将每个单元隔开!
while [ "$var" != "end" ]
if [ "$var" = "end ]