Skip to content

Instantly share code, notes, and snippets.

@rcanepa
Last active October 8, 2016 16:59
Show Gist options
  • Save rcanepa/5b5e776d7fffc87a040de34bd56149f3 to your computer and use it in GitHub Desktop.
Save rcanepa/5b5e776d7fffc87a040de34bd56149f3 to your computer and use it in GitHub Desktop.
Unix Tee
ls /bin/ /usr/bin/ | tee >(grep x > x_files) | sort | uniq | grep wr
^ ^ output the ones with an wr in their name
from the list of all binaries, save to x_files the ones that contains and x in their name
cat data.txt | tee >(pbcopy) >(do_stuff) >(do_more_stuff) | grep important-stuff
^ ^ ^
redirect the content of data.txt to three different tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment