Skip to content

Instantly share code, notes, and snippets.

@erynofwales
Created September 9, 2011 21:56
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 erynofwales/1207439 to your computer and use it in GitHub Desktop.
Save erynofwales/1207439 to your computer and use it in GitHub Desktop.
Pipe output of a command, newline separated, through a loop. This only works on KSH derivatives, including ZSH.
command | while read x; do [some stuff on $x]; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment