Re: issues using printf
- From: Seebs <usenet-nospam@xxxxxxxxx>
- Date: 14 Jan 2010 19:39:35 GMT
On 2010-01-14, peter sands <peter_sands@xxxxxxxxxxxxx> wrote:
Hello,
I am having problems using printf in presenting my data, in
that it is all over the place.
I am using the printf command:
printf "%-10s %10s %10 %40s\n" $cont $lock $set $time_cont
You probably want "-" on all of these. The third seems to have no
format specifier; you probably want an s. Finally, be sure to quote
the arguments.
printf "%8s" $time_cont
ought to give you
"Wed Apr 1 09:35:09BST 2009 "
(with no newline).
The reason is that, if you provide extra arguments, printf cycles through
its argument string for them, and $time_cont appears to expand to multiple
words.
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@xxxxxxxxx
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
.
- Follow-Ups:
- Re: issues using printf
- From: johnb850@xxxxxxx
- Re: issues using printf
- References:
- issues using printf
- From: peter sands
- issues using printf
- Prev by Date: Re: issues using printf
- Next by Date: Re: issues using printf
- Previous by thread: Re: issues using printf
- Next by thread: Re: issues using printf
- Index(es):
Relevant Pages
|