Skip to content

Instantly share code, notes, and snippets.

@aredridel
Created November 15, 2012 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aredridel/4076843 to your computer and use it in GitHub Desktop.
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
#!/bin/bash
tmp=/tmp/$$.pipe
mkfifo $tmp
logger -p local6.debug < $tmp &
exec > $tmp
rm $tmp
exec $@
@iarna
Copy link

iarna commented Nov 15, 2012

oh, awesome. Nice little hack... I hadn't been aware of the behavior of exec without arguments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment