[Bug 217159] ps default to 79 characters can break ps|grep in shell scripts

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Mar 4 21:02:24 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217159

Conrad Meyer <cem at freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|freebsd-bugs at FreeBSD.org    |cem at freebsd.org
                 CC|                            |cem at freebsd.org

--- Comment #1 from Conrad Meyer <cem at freebsd.org> ---
Some history on this one.

This dates back to an improvement by "bloom@" (Jim Bloom?) in BSD in 1985 to
use the terminal's size:

  > get screen width ioctl added and hold passwd file open
  https://svnweb.freebsd.org/csrg/bin/ps/ps.c?r1=18105&r2=18106& 

Prior to that, it was hardcoded at 80.

Kirk McKusick merged 5.4.1.1 (of what, I'm not sure), which changed the ioctl
to check stdout instead of stdin (CSRG r27213).

In 1990, marc@ added the fallback checking for stderr, stdout, and stdin, and
dropped the width from 80 to 79, as you see today.  The commit log was...
terse:

  > new version
  https://svnweb.freebsd.org/csrg/bin/ps/ps.c?r1=40675&r2=40674&pathrev=40675

It hasn't changed significantly since.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list