Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 开关大小写在cygwin中执行默认大小写(使用记事本+;+;)_Bash_Cygwin_Switch Statement - Fatal编程技术网

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,它正在工作