Last active
November 28, 2018 10:06
-
-
Save garethrees/0145acd3efd0541fba7486a505802bcd to your computer and use it in GitHub Desktop.
tee stderr and log both output streams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stderr as process output, and then stdout and stderr to independent log files | |
command 1> stdout.log 2> >(tee -a stderr.log >&2) | |
# stdout as process output, and then stdout and stderr to independent log files | |
command 2> stderr.log 1> >(tee -a stdout.log >&1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
STDOUT.puts 'hi from stdout' | |
STDERR.puts 'hi from stderr' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment