local file="$*"
file="$(mktemp -d)/${file//[^[:alnum:]]/}"
- echo "log of $prettycommand" >"$file"
- date >>"$file"
- echo >>"$file"
+ printf "%s\n%s\n\n" "log of $prettycommand" "$(date)" >"$file"
# we will propagate any errors
local e=$-
local ret=$?
[[ $e == *e* ]] && set -e
- echo >>"$file"
- echo "----------------" >>"$file"
- date >>"$file"
- echo "end of log" >>"$file"
+ printf "\n%s\n%s\n%s" "----------------" "$(date)" "end of log" >>"$file"
echo -n "\$?=$ret "
echo -n "$prettycommand"
local file="$*"
file="$(mktemp -d)/${file//[^[:alnum:]]/}"
- echo "log of $prettycommand" >"$file"
- date >>"$file"
- echo >>"$file"
+ printf "%s\n%s\n\n" "log of $prettycommand" "$(date)" >"$file"
# we will propagate any errors
local e=$-
local ret=$?
[[ $e == *e* ]] && set -e
- echo >>"$file"
- echo "----------------" >>"$file"
- date >>"$file"
- echo "end of log" >>"$file"
+ printf "\n%s\n%s\n%s" "----------------" "$(date)" "end of log" >>"$file"
echo -n "\$?=$ret "
echo -n "$prettycommand"