关于SHELL编程中的if嵌套问题
虽然写了几年的C/C++程序,但是SHELL却没有研究过.请各位大侠指点迷津
为什么不可以这样写,又或者我哪写错了?
if [ "$1" = "-f" ] && [ -n "$1" ]then# echo $1# rm.exe -f $2 echo "You can't use args -f"else# echo "error" echo "Are you sure to delete $1?" read A if [ $A = "y" ] //问题出在这,难道不可以这样写?不能这样嵌套么?不会吧... then rm.exe $1 else echo "delete is undo" fi fi