From owner-freebsd-questions Sat Aug 18 12:42: 1 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.freebsd-corp-net-guide.com (mail.freebsd-corp-net-guide.com [206.29.169.15]) by hub.freebsd.org (Postfix) with ESMTP id 0937437B418 for ; Sat, 18 Aug 2001 12:41:57 -0700 (PDT) (envelope-from tedm@toybox.placo.com) Received: from tedm.placo.com (nat-rtr.freebsd-corp-net-guide.com [206.29.168.154]) by mail.freebsd-corp-net-guide.com (8.11.1/8.11.1) with SMTP id f7IJfhb45487; Sat, 18 Aug 2001 12:41:43 -0700 (PDT) (envelope-from tedm@toybox.placo.com) From: "Ted Mittelstaedt" To: "Mike Meyer" , "parv" Cc: Subject: RE: ps & terminal width sensitivity inside a script Date: Sat, 18 Aug 2001 12:41:43 -0700 Message-ID: <002e01c1281d$cecba620$1401a8c0@tedm.placo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <15230.33826.857877.794531@guru.mired.org> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >-----Original Message----- >From: owner-freebsd-questions@FreeBSD.ORG >[mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Mike Meyer >Sent: Saturday, August 18, 2001 8:05 AM >To: parv >Cc: questions@FreeBSD.ORG >Subject: Re: ps & terminal width sensitivity inside a script > >People do protect. The question is what's to protest about the current >behavior of ps? > >First thing, I know of no way for a command to tell if it's being run >from a script. So your original request isn't possible. > One way that I know of that a command can tell that it's being run from a script, and that is to modify the code of the command so as to check for an option (-s or -script or -noscript something like that) and based on the presense or absense of this to decide if it's run from a script or not. Another way is to make the program like gzip which when called with a link to gunzip will work as a decompressor. Same binary, different task. >The behavior we're discussing is the default output width. The current >behavior is that it's the tty width if a tty can be found, otherwise >ps uses the historical value of 80. > >I can't think of any other behavior that is clearly superior, much Neither can I. Ted Mittelstaedt tedm@toybox.placo.com Author of: The FreeBSD Corporate Networker's Guide Book website: http://www.freebsd-corp-net-guide.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message