아래 스크립트에서 case구문이 제대로 동작을 안하는데 뭐가 잘못 된건지
답변 좀 부탁 합니다.
두번째 질문에 어떤 대답을 하던 간에 case에서 디폴트로 지정된 세번째의
경우가 실행이 되는데 이유를 모르겠네요. 고수님들의 한수 지도 부탁 합니다.
#Main routine
clear
echo
echo "Flle and directory mode changing program"
echo "Please, enter the directory to start:"
read start_dir
echo "Do you want to do for all subdirectories too?, (y/n)"
read ANSWER
echo "Mode for directories ?"
read DIR_MODE
echo "Mode for files ?"
read FILE_MODE
count=0
dir_flag=0
file_name=""
DIR_0=''
DDIR_0=''
echo "Start DIR is $start_dir"
cd $start_dir
case "$ANSWER" in
"[yY]" | "[Yy][Ee][Ss]" )
until [ "$DDIR_0" ]
do
file_change
if [ "$dir_flag" -eq 1 ];then
dir_move_fwd
else
dir_move_back
fi
done
;;
"[nN]*" )
file_change
;;
* )
echo "Sorry, answer not recognised"
echo "Please answer yes or no"
exit 1
;;
esac
exit 0--이 곳에 서명을 적어주십시오.
킬리만자로의 표범