Skip to content

Instantly share code, notes, and snippets.

@alexrutar
Last active February 11, 2022 17:52
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 alexrutar/dba100007db820db7171374341e31e4d to your computer and use it in GitHub Desktop.
Save alexrutar/dba100007db820db7171374341e31e4d to your computer and use it in GitHub Desktop.
Applying a command to each line of STDIN in fish

It's often useful to apply a command to each line of STDIN inside a pipeline. This is easy to do in fish:

ls | while read line; echo $line; end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment