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

2017-03-04 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217159

Conrad Meyer  changed:

   What|Removed |Added

   Assignee|freebsd-bugs@FreeBSD.org|c...@freebsd.org
 CC||c...@freebsd.org

--- Comment #1 from Conrad Meyer  ---
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=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=40674=40675

It hasn't changed significantly since.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


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

2017-02-18 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217159

Mark Linimon  changed:

   What|Removed |Added

   Keywords||patch

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


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

2017-02-16 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217159

Bug ID: 217159
   Summary: ps default to 79 characters can break ps|grep in shell
scripts
   Product: Base System
   Version: 11.0-RELEASE
  Hardware: Any
OS: Any
Status: New
  Severity: Affects Many People
  Priority: ---
 Component: bin
  Assignee: freebsd-bugs@FreeBSD.org
  Reporter: n.dee...@gmail.com

Created attachment 180064
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=180064=edit
Patch to set unlimited terminal size if we can't determine terminal
characteristics

FreeBSD ps defaults to output width of 79 characters if it cannot determine tty
width.  This can hurt scripts that use "ps | grep" and run, for example, ssh on
a non-interactive shell.

I've provided more context here:

http://deepix.github.io/2016/10/10/psww.html

I've also provided a patch as an attachment in unified diff format.

Note that this problem does not exist on Linux or OS X.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"