Date: Sat, 18 Aug 2001 12:41:43 -0700 From: "Ted Mittelstaedt" <tedm@toybox.placo.com> To: "Mike Meyer" <mwm@mired.org>, "parv" <parv_@yahoo.com> Cc: <questions@FreeBSD.ORG> Subject: RE: ps & terminal width sensitivity inside a script Message-ID: <002e01c1281d$cecba620$1401a8c0@tedm.placo.com> In-Reply-To: <15230.33826.857877.794531@guru.mired.org>
next in thread | previous in thread | raw e-mail | index | archive | help
>-----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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002e01c1281d$cecba620$1401a8c0>