COLUMNS in busybox?

Paul Fox pgf at brightstareng.com
Thu May 4 12:47:57 UTC 2006


 > > whats about 'stty size' ?
 > > NTL it would be a nice extension to have simpler way getting ROW and COL
 > > from stty.
 > 
 > yeah, Gentoo uses this as a fallback when COLUMNS is unavailable:
 > COLS=$(stty size 2>/dev/null | cut -d' ' -f2)

might not help in this case, because if you don't have COLUMNS, you
probably don't have arrays, but i've started avoiding the extra
cut or sed in cases like that with:
    results=( $(stty size) )
    COLS=${results[1]}
it's a little like the old "set -- $(stty size)" trick, but without
destroying the positional parameters.

paul
=---------------------
 paul fox, pgf at brightstareng.com



More information about the busybox mailing list