Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Justifying text output
- X-seq: zsh-users 7162
- From: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Justifying text output
- Date: Fri, 12 Mar 2004 23:33:40 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <1mm7og67rpkdy.dlg@xxxxxxxxxxxxxxxx> <30391.1079090901@xxxxxxxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
* Oliver Kiddle (2004-03-12 12:28 +0100)
> Thorsten Kampe wrote:
>> I wrote a little script[1] that compiles the main zsh config files. Is
>> there any way to make the "[ ok ]"/"[ failed ]" messages on the right
>> justified?
>
> I'll add a third way, also compatible with ksh: using printf.
>
> printf "${ltred}* ${white}%-60s [ ${ltred}failed${white} ]\n" "ERROR: $file - file not readable"
>
> They key bit is the '%-60s' in the format string which tells it to
> print the string right justified with a width of 60 spaces.
Thanks. The key bit is to understand it, but I haven't found any
documentation about that (just a small one in the susv3. Are there any
explanations available (along with this "${(r:70:):-" and
"${(r.40.):-" stuff)?
Thorsten
Messages sorted by:
Reverse Date,
Date,
Thread,
Author