Skip to content

Instantly share code, notes, and snippets.

@l0b0
Created December 7, 2010 11:27
Show Gist options
  • Save l0b0/731695 to your computer and use it in GitHub Desktop.
Save l0b0/731695 to your computer and use it in GitHub Desktop.
Output to *both* stdout and stderr
command | tee /dev/fd/2
# Can be used to debug variable computations - Just plonk the tee at the end:
# $ uid=$(id -u | tee /dev/fd/2)
# 1234
# $ echo $uid
# 1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment