[ale] Bash scripting and printf

Mike Fletcher fletch at phydeaux.org
Tue Sep 15 11:04:57 EDT 1998


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                 ,






More information about the Ale mailing list