[ale] Bash scripting and printf

Bob Kruger bkruger at mindspring.com
Tue Sep 15 10:31:23 EDT 1998


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.

>
>in C:
>
>  char name[] = "joe";
>  int num = 5;
>  printf("herro dere %s\n", name);
>  printf("the number is %d\n", num);
>
>in SH (and BASH):
>
>  export name="joe"
>  export num=5
>  printf "herro dere %s\n" $name
>  printf "the number is %d\n" $num
>
>and so on.
>
>ari

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.

Any hints?

Bob






More information about the Ale mailing list