FYI: pw group del -n <groupname starting with number> fails

Martin P. Hellwig mhellwig at xs4all.nl
Sun Aug 22 09:23:31 PDT 2004


Hi list,

While I was scripting together a batch user add script , I noticed that 
when a groupname starts with 1 or more numerics , deleting with pw group 
del -n fails.
However deleting the group using the ID works (pw group del -g <groupID>).

A workaround for this odd behaviour would be:
pw group del -g `grep GROUPNAME </etc/group | cut -f 3 -d:`
I thought you might want to know.

Here under is what I did to test:

# pw group add -n 5H1
# grep 5H1 < /etc/group
5H1:*:1002:
# pw group del -n 5H1
# grep 5H1 < /etc/group
5H1:*:1002:
# pw group del -n 5H1
pw: unknown group `5H1'
# grep 5H1 < /etc/group
5H1:*:1002:
# pw group del -g 1002
# grep 5H1 < /etc/group
hmm bummer so to check if it ain't local problem with pw I also did:

# pw group add -n t1st
# grep t1st </etc/group
t1st:*:1002:
# pw group del -n t1st
# grep t1st </etc/group
And also did it on my laptop with the same results, then I tested it 
with a name starting with 3 numbers:

# pw group add -n 123for
# grep 123 </etc/group
123for:*:1002:
# pw group del -n 123for
pw: unknown group `123for'
# grep 123 </etc/group
123for:*:1002:
# pw group del -g 123for
pw: unknown group `123for'
# pw group del -n 1002
# grep 123 /etc/group
--
mph




More information about the Bugs mailing list