diff options
-rwxr-xr-x | nscaw | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -55,14 +55,10 @@ username=$(whoami) # Attempt to run command within a time wrapper # <http://mywiki.wooledge.org/BashFAQ/032> exec 3>&1 4>&2 -time=$( { time "$@" 1>&3 2>&4 ; } 2>&1) ; ret=$? +TIMEFORMAT=$'real %3lR, user %3lU, sys %3lS\n' \ + time=$( { time "$@" 1>&3 2>&4 ; } 2>&1) ; ret=$? exec 3>&- 4>&- -# Munge the time to make it palatable as a single line -time=${time#$'\n'} # Strip leading newline -time=${time//$'\n'/, } # Change all newlines to comma-space -time=${time//$'\t'/ } # Change all tabs to spaces - # Decide return code and message based on command exit value case $ret in 0) |