当前位置: 技术问答>linux和unix
初学shell,请指教。。。
来源: 互联网 发布时间:2016-10-23
本文导语: 请帮忙解释两条错误信息,并指出其出现在什么情况下。 1. unexpected end of file. 2. menu(){ clear echo "1. add" echo "2. delete" echo "3. query" echo "4. modify" echo "0. exit" echo -n "please input your choice: " choice="" read...
请帮忙解释两条错误信息,并指出其出现在什么情况下。
1. unexpected end of file.
2. menu(){
clear
echo "1. add"
echo "2. delete"
echo "3. query"
echo "4. modify"
echo "0. exit"
echo -n "please input your choice: "
choice=""
read choice
case "$choice" in ##########: line 134:syntax error near unexpected token ‘$’inr''
1) add;; ##########:line 134:‘ case “$choice” in
2) delete;;
3) query;;
4) modify;;
0) exit;;
*) menu;;
esac
}
GNU bash,version 3.2.17(15)-release (i686-pc-cygwin)
1. unexpected end of file.
2. menu(){
clear
echo "1. add"
echo "2. delete"
echo "3. query"
echo "4. modify"
echo "0. exit"
echo -n "please input your choice: "
choice=""
read choice
case "$choice" in ##########: line 134:syntax error near unexpected token ‘$’inr''
1) add;; ##########:line 134:‘ case “$choice” in
2) delete;;
3) query;;
4) modify;;
0) exit;;
*) menu;;
esac
}
GNU bash,version 3.2.17(15)-release (i686-pc-cygwin)
|
非常怀疑lz的文件是dos格式的
可以通过dos2unix命令转换为unix格式
或者可以通过ue转换
可以通过dos2unix命令转换为unix格式
或者可以通过ue转换