我是新手,请问大侠这个是错在哪?? #bash if [ "$1" = "cm" ] then echo "ok" fi exit 0
linux-6lod:/home/yq # ./start.sh "cm" ./start.sh: line 7: syntax error: unexpected end of file linux-6lod:/home/yq # ./start.sh cm ./start.sh: line 7: syntax error: unexpected end of file linux-6lod:/home/yq #
#!/bin/bash
if [ "$1" = "cm" ]
then
echo "ok"
fi
exit 0
------解决方案-------------------- 你这样试试dos2unix start.sh 然后再执行./start.sh cm
------解决方案--------------------