命令列寫複雜語句

口袋呆呆發表於2024-04-24

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

相關文章