命令行写复杂语句

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

 

posted @ 2024-04-24 18:04  口袋呆呆  阅读(4)  评论(0编辑  收藏  举报