X-Git-Url: https://iankelling.org/git/?p=log-quiet;a=blobdiff_plain;f=logq-function;h=afe722fbbeab25b79787fa918f08c2732768ddd5;hp=8b930641a8222fba7134e19c148e5592e32c7c4b;hb=b9e35010945b3c40b5f1cc485e575ee5a41c3ad2;hpb=7d7c85818aed6fa15852a4b8dc914f06521ac9bb diff --git a/logq-function b/logq-function index 8b93064..afe722f 100644 --- a/logq-function +++ b/logq-function @@ -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,9 +40,9 @@ $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 -} +}