- 论坛徽章:
- 1
|
本帖最后由 木刀客 于 2015-07-17 21:14 编辑
while [ 1 -eq 1 ]
do
echo " Please input ID number: 4 digits "
read NN
NN3="K02-CD-$NN"
echo "Will make a direcory: $NN3"
if [ ! -d "$NN3" ]
then
mkdir $NN3
echo "mkdir---------"
break
else
echo "$NN3 is exist "
echo "Do you continue to use the $NN3 ? Y/N (No) "
read NN4
if [ $NN4 = "Y" ] || [ $NN4 = "y" ]
then
rm -fR $NN3/*
echo " continue--------"
break
fi
fi
echo " while end "
done
echo " after while "
当有存在的, 如果输入y, 继续, 输入其它字符则重新输入数字( 不做严格的判断) .
现在是在Y/N的那个位置直接输入回车后, 则显示
aaa.sh: test: argument expected
请教各位, 怎么解决这个"回车"的问题?? 好像是shell中IFS的问题, 但是不会解决??
|
|