Created
November 15, 2012 05:41
-
-
Save aredridel/4076843 to your computer and use it in GitHub Desktop.
Execute a logger as a subprocess and exec, leaving only the two child processes without using bash 4.0
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
#!/bin/bash | |
tmp=/tmp/$$.pipe | |
mkfifo $tmp | |
logger -p local6.debug < $tmp & | |
exec > $tmp | |
rm $tmp | |
exec $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
oh, awesome. Nice little hack... I hadn't been aware of the behavior of exec without arguments