Bash 开关大小写在cygwin中执行默认大小写(使用记事本+;+;)
错误出现在以下行中:Bash 开关大小写在cygwin中执行默认大小写(使用记事本+;+;),bash,cygwin,switch-statement,Bash,Cygwin,Switch Statement,错误出现在以下行中: while true ; do read -p "Proced with installation:(y/n) ?" ans case ans in "y"|"y" ) echo "y"; break ;; "n"|"N" ) echo "n"; break ;; * ) echo "invalid choice=$ans enter again : "; esac done 你想说
while true ; do
read -p "Proced with installation:(y/n) ?" ans
case ans in
"y"|"y" )
echo "y"; break ;;
"n"|"N" )
echo "n"; break ;;
* )
echo "invalid choice=$ans enter again : ";
esac
done
你想说:
case ans in
case $ans in
在中说case ans会导致bash
选择默认的case,因为您没有任何名为ans的case
此外,你可能想说:
case ans in
case $ans in
而不是
"y"|"Y" )
错误出现在以下行中:
while true ; do
read -p "Proced with installation:(y/n) ?" ans
case ans in
"y"|"y" )
echo "y"; break ;;
"n"|"N" )
echo "n"; break ;;
* )
echo "invalid choice=$ans enter again : ";
esac
done
你想说:
case ans in
case $ans in
在
中说case ans会导致bash
选择默认的case,因为您没有任何名为ans的case
此外,你可能想说:
case ans in
case $ans in
而不是
"y"|"Y" )
谢谢devnull,它正在工作谢谢devnull,它正在工作