待補 ...
讀取文件的每一行內容並輸出
#!/bin/bash # 方法1 while read line do echo $line done < a.txt # 方法2 cat a.txt | while read line do echo $line done # 方法3 # for line in `cat a.txt` for line in $(cat a.txt) do echo $line done
待補 ...
讀取文件的每一行內容並輸出
#!/bin/bash # 方法1 while read line do echo $line done < a.txt # 方法2 cat a.txt | while read line do echo $line done # 方法3 # for line in `cat a.txt` for line in $(cat a.txt) do echo $line done