tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ Crontab

How to pass back the array value? ▻

line-up a string with bash

In article <slrn8b8tgu.a9s.P@niels.paped.it>,
Pa.Ped.it @ www.fastflow.it/~paolop <spam@null.dev.it> wrote:
>is it possible to line-up a string (in bash) like the c function:
>
>printf("%-10s %+20s", string1, string2);

Would you believe

    printf '%-10s %+20s' "$STRING1" "$STRING2"

?

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: line-up a string with bash
Date: 24 Feb 2000 15:20:27 -0000
Message-ID: <893i8h$1ap$1@ltpcg.star.le.ac.uk>
References: <slrn8b8tgu.a9s.P@niels.paped.it>

△ comp.unix.shell △

◅ Crontab

How to pass back the array value? ▻