Change to "kludge option processing" in /bin/ps
Garance A Drosihn
drosih at rpi.edu
Wed Jun 9 22:26:49 GMT 2004
At 5:34 PM -0400 6/4/04, Garance A Drosihn wrote:
>At 10:13 PM +0200 6/3/04, Cyrille Lefevre wrote:
>>
>>ok, let's try another issue :
>>
>># ps -G " nobody "
>> PID TT STAT TIME COMMAND
>>75483 con- S 0:10.97 /usr/local/sbin/junkbuster configfile
>># ps -G ,nobody,
>>ps: Invalid (zero-length) group name
>>ps: Invalid (zero-length) group name
>># ps -G ,
>>ps: Invalid (zero-length) group name
>>ps: Invalid (zero-length) group name
>
>
>>why do you make a difference while parsing commas and spaces ?
When I first read this, I thought you meant that my latest `ps' was
not accepting blanks somewhere that it should have.
Now that I read it closer, it seems that you want me to treat a
comma the same as a blank. The spec that I am reading from talks
about "in the form of a <blank> or comma-separated list". To me,
that means "a list which is separated by one or more spaces or
tabs, or by a comma". Thus, one comma must be a separator between
two elements in a list.
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.
I can see that it could be argued that leading or trailing blanks
should also be considered a separator, and should also cause an
error. I prefer the present behavior, but I will change that to
generate an error if people really think it should be.
--
Garance Alistair Drosehn = gad at gilead.netel.rpi.edu
Senior Systems Programmer or gad at freebsd.org
Rensselaer Polytechnic Institute or drosih at rpi.edu
More information about the freebsd-arch
mailing list