diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-03 16:14:26 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-03 16:14:26 +1200 |
commit | 01a736840e66a9e7bc4104175b9f7de6279add04 (patch) | |
tree | a924c691460293a53d315adc54f6cea9e4e72cc0 | |
parent | Check for too few args in tlcs(1) (diff) | |
download | dotfiles-01a736840e66a9e7bc4104175b9f7de6279add04.tar.gz dotfiles-01a736840e66a9e7bc4104175b9f7de6279add04.zip |
Use self var in tlcs(1)
-rwxr-xr-x | bin/tlcs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,6 @@ #!/bin/sh # Execute a command and tag the output of the stdout and stderr streams. +self=tlcs # Set the default prefixes and suffixes for stdout/err out_pref='stdout: ' @@ -29,7 +30,7 @@ shift "$((OPTIND-1))" # We need at least one more argument if [ "$#" -eq 0 ] ; then - printf >&2 'tlcs: Need a command to run\n' + printf >&2 '%s: Need a command to run\n' "$self" exit 2 fi @@ -74,7 +75,7 @@ cleanup() { for sig in EXIT HUP INT TERM ; do trap cleanup "$sig" done -td=$(mktd tlcs) || exit +td=$(mktd "$self") || exit # Execute the command, passing stdout and stderr to tl(1) calls as appropriate # via named pipes |