3 local help="Usage: logq [-h|--help] COMMAND [ARG...]
5 Log Quietly. Run COMMAND with ARGs, log to temp file. Output return code,
8 Minor details: Use logsave if available, which adds informational header/footer
9 to log file. Logfile is put in random temp dir, with filename made from the
10 alphanumeric characters of COMMAND + ARGs."
12 if [[ $1 == --help ||
$1 == -h ]]; then
16 if [[ $# == 0 ]]; then
17 echo "error: need 1 or more arguments
25 prettycommand
+="[$index]$x "
31 file="$(mktemp -d)/${file//[^[:alnum:]]/}"
33 echo "log of $prettycommand" >"$file"
37 # we will propagate any errors
39 [[ $e == *e
* ]] && set +e
42 [[ $e == *e
* ]] && set -e
45 echo "----------------" >>"$file"
47 echo "end of log" >>"$file"
50 echo -n "$prettycommand"