[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] Bash scripting and printf



Bob Kruger <bkruger at mindspring.com> writes:

> At 12:38 PM 9/14/98 -0400, you wrote:
> 
> >are you familiar with C?
> >its format is similar to C's printf.
> 
> Not really.  However, I have worked with Perl a good bit.

	man 3 printf

> 
> Thanks.  I got this to work just fine, but still can not find a way to do
> the following:
> 
> Right justify.
> Buffer with blank spaces a variable being printed.

	Specify a width in the format string, negative to left justify:

$ printf "%20s," "Foobar"
                 Foo,
$ printf "%-20s," "Foobar"
Foo                 ,