Skip to content

Instantly share code, notes, and snippets.

@zsxwing
Last active December 15, 2015 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zsxwing/5329167 to your computer and use it in GitHub Desktop.
Save zsxwing/5329167 to your computer and use it in GitHub Desktop.
How to iterate lines in a file or generated by a command correctly.
while read line; do
echo $line;
done < <(cat test.txt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment