Created
September 26, 2011 14:24
-
-
Save happymcplaksin/1242352 to your computer and use it in GitHub Desktop.
This file contains 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
start_logging(){ | |
# Michael is so smart | |
PIPE=/tmp/CornCobPipe.$$ | |
mknod $PIPE p # Create named pipe to talk to logchild | |
trap 'rm -rf $PIPE' exit # Remove pipe on exit | |
:>>$LOG # Create the log if it doesn't exist | |
tee -a $LOG <$PIPE & # And our child is born | |
exec >>$PIPE 2>&1 # All output goes to std{err,out} & log | |
# Michael is no longer smart | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment