diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-19 23:22:51 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-19 23:22:51 +1200 |
commit | 6daae9a75afa12f929be810a52ad21139233adfa (patch) | |
tree | 409f8935029dca341ee4809581d375bd3a42cae4 /bin/try | |
parent | Merge branch 'master' into freebsd (diff) | |
parent | Update documentation for br(1) and xgo(1) (diff) | |
download | dotfiles-6daae9a75afa12f929be810a52ad21139233adfa.tar.gz dotfiles-6daae9a75afa12f929be810a52ad21139233adfa.zip |
Merge branch 'master' into freebsd
Diffstat (limited to 'bin/try')
-rwxr-xr-x | bin/try | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -26,7 +26,8 @@ if [ "$#" -eq 0 ] ; then exit 2 fi -# Create a buffer file for the error output, and clean up the file when we exit +# Create a temporary directory with name in $td, and handle POSIX-ish traps to +# remove it when the script exits. td= cleanup() { [ -n "$td" ] && rm -fr -- "$td" @@ -40,9 +41,9 @@ for sig in EXIT HUP INT TERM ; do trap "cleanup $sig" "$sig" done td=$(mktd "$self") || exit -errbuff=$td/errbuff # Open a filehandle to the error buffer, just to save on file operations +errbuff=$td/errbuff exec 3>"$errbuff" # Keep trying the command, writing error output to the buffer file, and exit |