Skip to content

Instantly share code, notes, and snippets.

@Chunlin-Li
Created January 16, 2016 09:05
Show Gist options
  • Save Chunlin-Li/f818bb17c19fbbccd876 to your computer and use it in GitHub Desktop.
Save Chunlin-Li/f818bb17c19fbbccd876 to your computer and use it in GitHub Desktop.
shell 脚本中 按行读取文件
while read aline;
do 
  echo $aline
  some code....
done < targetFile.log

read 是系统自带的文件读取操作.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment