Skip to content

Instantly share code, notes, and snippets.

@evantbyrne
Created April 12, 2014 23:09
Show Gist options
  • Save evantbyrne/10561375 to your computer and use it in GitHub Desktop.
Save evantbyrne/10561375 to your computer and use it in GitHub Desktop.
Run command per line of file with bash
#!/bin/bash
# Example usage: ./each echo < list.txt
# Output: One Two Three
xargs -0 $1 < <(tr \\n \\0 $in)
One
Two
Three
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment