[Gllug] Pipes truncating STDOUT to 80 chars

Tethys tet at accucard.com
Fri Nov 8 13:59:16 UTC 2002


Rhys Hopkins writes:

>Does anyone know why RedHat ( in this case specifically Red Hat 7.2 )
>truncates standard output at 80 characters when it is put through a pipe,
>but SuSE ( in this case specifically SuSE 7.0 ) gives you output for the
>full width of your terminal window ?

It's not the pipe that's truncating the output, it's ps. Sounds like
it's a bug, because it should check if the output is to a terminal
and use that to decide the format of the output (c.f. ls). Try reporting
it at http://bugzilla.redhat.com

>This is particularly annoying when doing e.g. 
>
>What can I change in the RedHat system to make it act like SuSE ?

You can either force a wide column width:

	COLUMNS=1000 ps -ef | grep httpd

or you can just use sane BSD ps syntax:

	ps auxww | grep httpd

Just as an aside... if you're thinking of doing this from within a script,
don't! Grepping the process table is an unreliable method for finding out
pretty much anything, and there are better alternatives available.

Tet

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list