[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] procps output truncated due to bash setting $COLUMNS
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] procps output truncated due to bash setting $COLUMNS |
Date: |
Wed, 2 Jan 2013 08:19:25 -0500 |
User-agent: |
Mutt/1.4.2.3i |
On Tue, Jan 01, 2013 at 01:20:00PM +0200, Pierre Gaston wrote:
> On Tue, Jan 1, 2013 at 8:26 AM, <address@hidden> wrote:
> > Description:
> > procps-3.3.3 and later versions truncate their output at $COLUMN
> > columns, for example when executing `ps | less -S`.
> Bash sets COLUMNS when interactive, but it does not export it so it
> should not interfere with other tools unless it is exported in one of
> your startup files.
ps limits its output to the screen width by default because it's trying
to be *helpful*. In any case, the behavior of ps is not something that
one would change by "fixing" Bash. If you have an issue with your OS
vendor's ps command, then file a bug report with the OS.
"procps" implies you're running Linux, so if you want ps to ignore your
terminal width, you can use the 'w' or '-w' option as documented in the
Linux ps(1) man page:
w Wide output. Use this option twice for unlimited width.
-w Wide output. Use this option twice for unlimited width.
The 'w' option comes from the BSD ps syntax, and has been around for
decades. '-w' was probably added just in case someone screws up and
puts a '-' in front of it, or in case someone tries to combine the BSD
'w' option with the SysV/POSIX dash-prefixed options.