Created
March 28, 2014 17:00
-
-
Save dualbus/9837606 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
log_file=$1 | |
reopen() { | |
exec > "$log_file" 2>&1 | |
} | |
trap reopen HUP | |
reopen | |
while IFS= read -r line; do | |
printf '%s\n' "$line"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment