X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=logq;fp=logq;h=bb987431c014e109258be9e2b193535fa54c40c0;hb=b9e35010945b3c40b5f1cc485e575ee5a41c3ad2;hp=2ac002635d89be7d2ce15f23c911f85f79543a1d;hpb=7d7c85818aed6fa15852a4b8dc914f06521ac9bb;p=log-quiet diff --git a/logq b/logq index 2ac0026..bb98743 100755 --- a/logq +++ b/logq @@ -18,7 +18,7 @@ alphanumeric characters of COMMAND + ARGs." $help" return 1 fi - + local index=0 local x prettycommand for x in "$@"; do @@ -26,12 +26,12 @@ $help" index=$(( index+1 )) done - + local file="$*" file="$(mktemp -d)/${file//[^[:alnum:]]/}" - printf "%s\n%s\n\n" "log of $prettycommand" "$(date)" >"$file" - + printf "%s\n%s\n\n" "log of $prettycommand" "$(date)" >"$file" + # we will propagate any errors local e=$- [[ $e == *e* ]] && set +e @@ -40,10 +40,10 @@ $help" [[ $e == *e* ]] && set -e printf "\n%s\n%s\n%s" "----------------" "$(date)" "end of log" >>"$file" - + echo -n "\$?=$ret " echo -n "$prettycommand" echo "[log] $file" return $ret -} +} logq "$@"