Hi Padraig,
> Is a script not convenient?
I'm out of touch in the dark arts of shell scripting - I was about to
pull out my O'Reilly Python books and rustle something together, but
it's crazy busy at the start of the year and if I could save myself a
few hours scripting/testing/fixing it would be a bonus. I had previously
encountered a utility "addusers" which - as the name implies - adds
multiple users from a list, and I was wondering if an equivalent utility
existed for deleting them.
> The following is just off the top of my head
>
> group="class_of_2006"
> users=`grep $group /etc/group| cut -d: -f4`
> IFS=','
> for user in $users; do
> userdel -r $user
> done
> groupdel $group
Thank you very much for this - I'll give it a try (having run it through
my brain first).
Regards,
Cormac.
Pádraig Brady wrote:
> Cormac McClean wrote:
>>>Hi,
>>>>Teach Linux System Administration to Computer Engineers and I run a
>>server for their accounts (NIS/NFS/Samba).
>>>>Is there a convenient way to remove multiple users (last year's classes)
>>rather than (a) doing them individually by hand, or (b) writing a script?
>>>>I have googled and found nothing of use.
>>>>Thanks in advance,
>>Cormac.
>>> Is a script not convenient?
> The following is just off the top of my head
>> group="class_of_2006"
> users=`grep $group /etc/group| cut -d: -f4`
> IFS=','
> for user in $users; do
> userdel -r $user
> done
> groupdel $group
>> Pádraig.
>> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email> ______________________________________________________________________
>
The information contained in this email is confidential and is designated solely for the attention of the intended recipient(s). If you have received this email in error, please do not use or transmit it for any purpose but rather notify us immediately and delete all copies of this email from your computer system(s). Unless otherwise specifically agreed by our authorised representative, the views expressed in this email are those of the author only and shall not represent the view of or otherwise bind Athlone Institute of Technology. Contact administrator at ait.ie or telephone 090 6471858.
_____________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!