COLUMNS in busybox?
Rich Felker
dalias at aerifal.cx
Mon May 1 19:41:10 UTC 2006
On Mon, May 01, 2006 at 03:23:03PM -0400, Rob Landley wrote:
> On Sunday 30 April 2006 3:50 pm, Alexander Krause wrote:
> > Hi,
> >
> > I wrote a script to write stuff on the right side of a terminal for example
> > like those '[ OK ]' messages in init-scripts.
> >
> > I'd like to implement it in a shell script like this:
> > echor() {
> > printf "%${COLUMNS}s%s" $1
> > }
> >
> > The only problem I'm having is, that BB does not provide COLUMNS in my ENV
> > :-(
>
> Ok, when you say "bb does not provide" I'm assuming you're running one of
> busybox's shells? (Which one?)
>
> Also note that this can't automatically correct if you resize an xterm after
> the shell launches your applet, so it's never going to be reliable.
COLUMNS in the shell is "supposed to" (loosely speaking since there is
no standard) update automatically if the terminal size changes. So as
long as the app in question is a shell script it should be fine.
On the other hand I find this whole Redhat-style '[ OK ]' thing
incredibly ugly and unreadable and would ask everyone to rethink
whether it's really a good idea. On a wide terminal it's impossible
for your eyes to line up the two columns and tell which item failed.
Rich
More information about the busybox
mailing list