From: Ian Kelling Date: Thu, 24 Jul 2014 01:27:14 +0000 (-0700) Subject: change to more appropriate printf X-Git-Url: https://iankelling.org/git/?p=log-quiet;a=commitdiff_plain;h=7d7c85818aed6fa15852a4b8dc914f06521ac9bb;hp=704248ca7f3cb8208aad63453f9bae5c613fdc10 change to more appropriate printf --- diff --git a/logq b/logq index b88e35e..2ac0026 100755 --- a/logq +++ b/logq @@ -30,9 +30,7 @@ $help" 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=$- @@ -41,10 +39,7 @@ $help" 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" diff --git a/logq-function b/logq-function index c2b99f2..8b93064 100644 --- a/logq-function +++ b/logq-function @@ -30,9 +30,7 @@ $help" 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=$- @@ -41,10 +39,7 @@ $help" 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"