[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: batch add users to group



On Sat, May 04, 2002 at 12:40:35AM -0700, Mike Egglestone wrote:
> I would like to add some users to a group in batch format.
> Something along these lines:
> 
> adduser `awk F: '&3 >= 1000 {print $1}' /etc/passwd` groupname

Something more like this would work:

  for x in `awk -F: '$3 >= 1000 {print $1}' /etc/passwd`; do adduser $x groupname; done

... or:

  awk -F: '$3 >= 1000 {print $1}' /etc/passwd | xargs -iUSER adduser USER groupname

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: