Suppress Line Wrap?

lrhorer's picture


In bash, the default when outputting to stdout is to wrap any lines
wider than the console display. Is there a way to suppress this?
During script execution, I want certain lines to be overwritten. This
can be accomplished with the /r escape sequence rather than /n, but if
the line is longer than the width of the display, it will still scroll
the display.

On a related note, bash doesn't seem to be setting the $COLUMNS variable
correctly in a sub-shell. At the console, the $COLUMNS variable
contains the correct terminal width. If I change the terminal width,
the $COLUMNS variable updates accordingly. If I run a bash script,
however, this feature no longer works. The $COLUMNS variable remains
null no matter what I try:

killall -28 VDifferential
shopt -s checkwinsize

Neither works. I checked, and the checkwinsize option is enabled, but
the $COLUMNS variable remains null even if I re-size the window.

This is in a bash window in KDE4 under Debian Squeeze.