bash 逐行读取文件
In Bash, how to process a file line by line? The file is a plain text line like input.txt. As an example, the process can be to just print it out.
在Bash中 ,如何逐行处理文件? 该文件是纯文本行,例如input.txt。 例如,该过程可以只是将其打印出来。
In Bash to process a file ./input.txt line by line:
在Bash中逐行处理文件./input.txt:
while read line ; do
echo $line
done < ./input.txt
Reference: https://www.systutorials.com/qa/2166/how-to-process-a-file-line-by-line-in-go
参考 : https : //www.systutorials.com/qa/2166/how-to-process-a-file-line-by-line-in-go
Answered by dtivl.
dtivl回答。
翻译自: https://www.systutorials.com/how-to-process-a-file-line-by-line-in-bash/
bash 逐行读取文件