看板 FB_bugs 關於我們 聯絡資訊
On Tue, 25 Aug 2009 brian@FreeBSD.org wrote: > Synopsis: ps(1) output depends on terminals column width when piping or redirecting > > State-Changed-From-To: open->closed > State-Changed-By: brian > State-Changed-When: Tue Aug 25 07:56:45 UTC 2009 > State-Changed-Why: > I agree with Michael. ps(1) checks stdout, stderr then stdin to see if > it's a tty, and if none are will set the width to 79. > > Scripts should either use pgrep or pkill, or else use ps -ww and also > possibly -o comm or -o command. Er, don't you agree with me? I sent a long reply, including to bug-followup, but it isn't in the PR followup :-(. Summary: (1) checking stdin is bogus and is what causes this problem, but I can't see a better way to handle cases like "ps | less" where the output is redirected but the final output is still to a tty. (2) handling of widths is mostly broken, starting with it mostly only applying to the last field. Bruce _______________________________________________ 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"