3
bash里如何循环读取文件
source link: https://www.seis-jun.xyz/read-file-bash
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
bash里如何循环读取文件
Bash操作简单,可以处理简单的计算等。有些时候会遇到文件的读取问题,那如何对文件进行循环逐行读取呢?
这样就可以了:
while read -r line
do
array=(${line///})
echo ${array[1]}
done < the_file
有疑问或建议请发邮件到[email protected]。
- 本文作者: Jun Xie
- 本文链接: http://www.seis-jun.xyz/read-file-bash
- 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK