当前位置: 技术问答>linux和unix
简单的shell脚本运行抱错,请帮忙看下
来源: 互联网 发布时间:2017-01-23
本文导语: #!/bin/sh #this is test if["1" > "0"] then echo "out 1" fi ./test123运行提示 if[1:command not found | if语句里 [ "1" > "0" ] 两边都需要空格的 | 加空格 | [前...
#!/bin/sh
#this is test
if["1" > "0"]
then
echo "out 1"
fi
./test123运行提示 if[1:command not found
#this is test
if["1" > "0"]
then
echo "out 1"
fi
./test123运行提示 if[1:command not found
|
if语句里 [ "1" > "0" ] 两边都需要空格的
|
加空格
|
[前后要加空格
在linuxshell里,空格很重要
在linuxshell里,空格很重要
|
if[ "1" > "0" ]
then
echo "out 1"
fi
then
echo "out 1"
fi
|
#!/bin/sh
#this is test
if [ "1" > "0" ] #加空格
then
echo "out 1"
fi
# chmod +x test.sh
# ./test.sh
out 1
#this is test
if [ "1" > "0" ] #加空格
then
echo "out 1"
fi
# chmod +x test.sh
# ./test.sh
out 1