
bash: line 9: syntax error near unexpected token `)' bash: line 9: `a|A) ' 我不知道哪里错了,怎么改
#!bin/bash#versionlinux.shecho"****************************************\n"echo-e"plea...
#!bin/bash
#versionlinux.sh
echo "****************************************\n"
echo -e "please select the options in the follows\n"
echo -e "1.the operating system [a]\n"
echo -e "2.Domain Name System [b]\n"
echo -e "3.the CPU of the system [c]\n"
read choice
case $choice in
a|A)
uname
;;
b|B) uname -n
;;
c|C) uname -p
;;
*) echo "Select error!";;
esac 展开
#versionlinux.sh
echo "****************************************\n"
echo -e "please select the options in the follows\n"
echo -e "1.the operating system [a]\n"
echo -e "2.Domain Name System [b]\n"
echo -e "3.the CPU of the system [c]\n"
read choice
case $choice in
a|A)
uname
;;
b|B) uname -n
;;
c|C) uname -p
;;
*) echo "Select error!";;
esac 展开
1个回答
展开全部
没有错误。
我这里运行正常。
建议
case $choice in
改为:
case "$choice" in
更可靠些。
我这里运行正常。
建议
case $choice in
改为:
case "$choice" in
更可靠些。
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询