On Sat, May 04, 2002 at 12:40:35AM -0700, Mike Egglestone wrote:
> Hello,
>
> I would like to add some users to a group in batch format.
> Something along these lines:
Why? [I'm not sure what you're trying to do, but something is not right
here]
Why not use the "others" permissions on the files instead?
> adduser `awk F: '&3 >= 1000 {print $1}' /etc/passwd` groupname
>
> but this obviously doesn't work.
> I used to know of a command but I forgot it.
Don't forget it then!
awk -F: '$3 >= 1000 {printf("adduser %s thebeatles\n",$1);}' /etc/passwd | sh
--
Karl E. Jørgensen
karl@jorgensen.com
www.karl.jorgensen.com
Please read http://www.pantsfullofunix.net before reporting bugs in my code.
Attachment:
pgpzznKfSGj1X.pgp
Description: PGP signature