1、在命令列上寫分支語句
read -e -p "f:" f; if [ -z "$f" ]; then echo "f is null"; else echo "f=$f"; fi
2、在命令列寫迴圈預計
o='abc def'; for i in $o; do echo "i=$i"; done
o在檔案o.txt : source o.txt; for i in $o; do echo "i=$i"; done
1、在命令列上寫分支語句
read -e -p "f:" f; if [ -z "$f" ]; then echo "f is null"; else echo "f=$f"; fi
2、在命令列寫迴圈預計
o='abc def'; for i in $o; do echo "i=$i"; done
o在檔案o.txt : source o.txt; for i in $o; do echo "i=$i"; done