--- Andrew Nix <andrew.nix@st-paulshigh.manchester.sch.uk> wrote: > > --- Andrew Nix <andrew.nix@st-paulshigh.manchester.sch.uk> wrote: > >
--- Chris Puttick <chris@centralmanclc.com> wrote: > I believe you
can
just modify the spreadsheet and use the newusers
command again - it can update bulk users as well as create them. Have a look at "man newusers" and "man 5 passwd" for details.
I had a look at the help for these two things chris but as I have no idea what so ever as the thier function. It makes using them a little difficult! An example would be really helpful!
Assuming that you have the list of users, export it to a cvs (a comma separated file) and issue the command:
How do I export my spreadsheet to a cvs file? And, what is a cvs file?
Well, assuming it is Office2000 (I stay away from M$ products), etc, just
click "save as" then select the filetype as cvs....
I use OOo 1.1beta2. I had a look in the save as options and it said nothing about cvs files. I ask again what is a cvs file?
Sorru, I thought I had explained :( a cvs file is a comma separated list of all your columns in your spreadsheet, i.e. say you had a spreadsheet like this: 1 2 3 a zz zz aa b qw gh xz c vf tg jk then your cvs file would look like: zz,zz,aa qw,gh,xz vf,tg,jk
Alternativelty, you dont need to export it if you can manually extract all the usernames and save them to a separate plain text file.
for i in $(cat ./the_file | awk -F, '{print $NUM}'); do useradd $NUM -G groupname; done
Then the above script will still apply
Saving it in a text file willwont make it a cvs file tho will it? Does that mean that it doesnt acctually have to be in a cvs file at all?
yes, as long as the usernames are listed one after the other in the file like this: user1 user2 user3 etc... -- Thomas Adam
You'll have to change the above so that $NUM is the column number that the username appears in (i.e. $1, $2, etc) and change "groupname" as appropriate.
-- Andrew Nix
St Pauls Catholic High School Firbank Road Newall Green Wythenshawe Manchester M23 2YS tel: 0161 4375841 ext 168 fax: 0161 4982030
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
===== Thomas Adam "The Linux Weekend Mechanic" -- www.linuxgazette.com ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/