Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 2009 21:20:03 GMT
From:      Michael Gmelin <freebsdusb@bindone.de>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/137647: ps output depends on terminals column width when piping or redirecting
Message-ID:  <200908102120.n7ALK37X003832@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/137647; it has been noted by GNATS.

From: Michael Gmelin <freebsdusb@bindone.de>
To: Ivan Radovanovic <rivanr@gmail.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/137647: ps output depends on terminals column width when
 piping or redirecting
Date: Mon, 10 Aug 2009 22:49:52 +0200

 Try using ps -wwaxj > ps.txt
 
 afaik this is the intended behaviour of ps.
 
 Ivan Radovanovic wrote:
 >> Number:         137647
 >> Category:       misc
 >> Synopsis:       ps output depends on terminals column width when piping or redirecting
 >> Confidential:   no
 >> Severity:       non-critical
 >> Priority:       low
 >> Responsible:    freebsd-bugs
 >> State:          open
 >> Quarter:        
 >> Keywords:       
 >> Date-Required:
 >> Class:          sw-bug
 >> Submitter-Id:   current-users
 >> Arrival-Date:   Mon Aug 10 20:40:01 UTC 2009
 >> Closed-Date:
 >> Last-Modified:
 >> Originator:     Ivan Radovanovic
 >> Release:        7.2
 >> Organization:
 >> Environment:
 > FreeBSD azdaja.softwarehood.com 7.2-STABLE FreeBSD 7.2-STABLE #0: Mon Aug  3 17:12:57 CEST 2009     rivan@azdaja.softwarehood.com:/usr/src/sys/i386/compile/Azdaja  i386
 >> Description:
 > ps command formats its output according to setting of terminal it is running on even when piped or redirected to a file. This can cause serious confusion when using it in combination with other commands (for example ps -axj | grep opera won't give any output regardless opera browser is running in the example in "how to repeat" section)
 > 
 >> How-To-Repeat:
 > open xterm, set its width to 40 columns, do
 > ps -axj > ps.txt
 > ps.txt will be 40 columns wide
 > 
 >> Fix:
 > use isatty or stat to determine if ps's output is terminal
 > 
 >> Release-Note:
 >> Audit-Trail:
 >> Unformatted:
 > _______________________________________________
 > freebsd-bugs@freebsd.org mailing list
 > http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
 > To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908102120.n7ALK37X003832>