Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Justifying text output
- X-seq: zsh-users 7158
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>
- Subject: Re: Justifying text output
- Date: Fri, 12 Mar 2004 12:28:21 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <1mm7og67rpkdy.dlg@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <1mm7og67rpkdy.dlg@xxxxxxxxxxxxxxxx>
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.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author