Hello Anton, David[1], On Wed, 28 Sep 2011, Anton Aylward wrote:
David C. Rankin said the following on 09/28/2011 07:09 PM:
# write stuff echo -e "\nTape: $tapect -- \n">> $tmpapp echo -e "\nCapture Started: $(date '+%b %e %T')\n" | tee -a $tmpfn
Are you sure that you don't mean
echo -n -e "\nTape: $tapect -- \n">> $tmpapp echo -n -e "\nCapture Started: $(date '+%b %e %T')\n" | tee -a $tmpfn
And you do realise that what you see on the screen and what goes into the file in the second case are two different things.
Actually, he probably wants to use: printf "Tape: %s -- \n" "$tapect" >> $tmpapp date '+Capture Started: %b %e %T' | tee -a $tmpfn Remember: strftime/date take arbitrary strings with embedded %-escapes (though current 'date' seems to add an implicit '\n' at the end, I don't remember that from strftime and maybe older 'date' versions (or were those gobbled-by-$() '\n'?)) [those '\n' at the beginning seem dubious, add them if actually wanted] Oh, and BTW: if you do a lot of redirecting stdout/stderr stuff to a logfile: reroute stdout/stderr via exec at the start of the script. See: man -P 'less +"/^REDIR"' bash e.g. do a exec &>>$tmpapp or a exec 1>>foo.log exec 2>>foo.err at the start of the script. Also see 'man logger', e.g. foo | logger -s -t foo Use '{ ... } | logger -s -t foo' for logging multiple commands.
As for the 80 spaces ... Dunno.
See my first mail ;) HTH, -dnh [1] yikes, that always looks so self-referential ;) -- just had a great phone call from a user Her : How is it you always maintain a sense of humour? Me : Because I'm completely insane. Her : ...yyyyyes. Yes, that would explain it. Bye! -- Jim -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org