Operating System - HP-UX
1819871 Members
2609 Online
109607 Solutions
New Discussion юеВ

no leading numbers with groupadd ?

 
Richard Price_1
Advisor

no leading numbers with groupadd ?

hp-ux 11.23 on Itanium2

Hello,

I want to create a group with a leading number e.g. 123test

If I add this group to /etc/group by editing this file then 123test seems to work on the system . The group exists, I can newgrp to it, I can create files and the have 123test as their group. It works with samba etc.

However, if I try to create a leading number group with groupadd, I get this error...

# groupadd 34getrid"
Invalid name specified: '34getrid'

I can get round this by manually editing the group file - a bit of a pain because I have scripts that use groupadd - , but is there a reason why groupadd won't allow leading numbers. Might I be creating problems down the line by creating these groups ?
2 REPLIES 2
Rick Garland
Honored Contributor

Re: no leading numbers with groupadd ?

Had a similar situation with the passwd file as well. Would not allow numerics as the 1st character.

We used the automated script that called the useradd command but the initial account name had an alpha character to start (x1234). Once account was added, use sed to edit the passwd file and remove the leading 'x' from the account name
A. Clay Stephenson
Acclaimed Contributor

Re: no leading numbers with groupadd ?

Unlike the login name in the passwd file which must begin with an alpha character (man 4 passwd) there are no such requirements for the composition of the group name. You may have problems with SAM commands which might expect group names to begin with a letter but there is no hard UNIX reason for this.
If it ain't broke, I can fix that.