Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jun 2004 18:03:43 +0200
From:      "Cyrille Lefevre" <clefevre-lists@9online.fr>
To:        <arch@freebsd.org>, "Garance A Drosihn" <drosih@rpi.edu>
Subject:   Re: Change to "kludge option processing" in /bin/ps
Message-ID:  <042401c45096$d68f2b80$7890a8c0@dyndns.org>
References:  <200406041933.i54JX9kj040764@mail.gits.dyndns.org> <p0602042fbce693792f92@[128.113.24.47]> <p0602044ebced3d3afbd0@[128.113.24.47]> <038901c45085$a08bde90$7890a8c0@dyndns.org> <p0602045ebcf0d0336fe7@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help
"Garance A Drosihn" <drosih@rpi.edu> wrote:
> At 4:00 PM +0200 6/12/04, Cyrille Lefevre wrote:
> >  > So, `ps -G ,nobody,' is a list with three elements, two of which
> >>  are null.  Null elements are an error.  So, you get two error
> >>  messages.  As I sit here right now, I still think that is the
> >>  correct and reasonable behavior, so I have no plans to change it.
> >
> >think about not well formed shell script. it isn't necessary to
> >display an error message like this, more important, ps should not
> >stop on such error, al least, it should display process info for
> >non- empty elements. however, it's far better than to believe ,,
> >means 0 :) imagine something like :  ps -o pid= ,, | xargs kill
> 
> If `ps -p ,' is an error instead of process zero (which is a change
> that I just made after you pointed it out to me), then `ps -p 1,'

no, the cases are differents, in the first case, you have no process
id at all, in the second case, you have one process id. and it seems
normal to bail out if you have no process id to list and not normal
if there is at least one process id to list.

> is also an error.  I *am* thinking about shell-scripts which are not
> well-formed.  My thought is that I should not be second-guessing
> what the script-writer "probably meant".  If they can't get the
> right parameters to `ps', then `ps' should treat that as an error.
> 
> So, I still have no plans to change this behavior.  The behavior
> that is there is, I believe, both correct and reasonable -- even
> if other OS's do it some other way.


Cyrille Lefevre.
-- 
mailto:clefevre-lists@9online.fr


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?042401c45096$d68f2b80$7890a8c0>