Greetings people,
I need some help or suggestion for a script (actually for my girlfriend who is doing a degree in Comp. Sci in USA). She has a subject on Sys Admin. on Linux :) and on my last trip to USA I installed her a RedHat box at home since they use RH at Uni. , helped her a lot with some other exams on basic sys admin in Linux, inst. etc but I am nowhere with scripting. So here we go the assignment in full :
1. Write the AUFF (Add User From File) script. 2. This script should take a filename as a command line parameter. 3. This file should contain all of the "standard" options for the add user command. 4. You get to decide the format. 5. You get to document the script. 6. You get to write a "man" document supporting your script. 7. Submit a printout of the script, a test file, and your "man" document. 8. Implementing any advanced parsing features will earn you bonus points. (optional)
Sorry for the long list and any help or suggestions greatly appreciated.
I'm back to College now in Ipswich and again as always if someone needs some Linux ISO's and lacks a broadband conn. I am more then happy to burn some fresh ones for any user in the group (for free of course:). I will try to make some of our meetings as I do miss them :)
thanks for your time and hope to see you all again later.
Bamir.
forgot one thing
x. The file should contain 1 row per user to add.
cheers :)
----- Original Message ----- From: "CEPi" cepi@ntlworld.com To: main@lists.alug.org.uk Sent: Saturday, April 13, 2002 1:15 AM Subject: [Alug] Help with a script :)
Greetings people,
I need some help or suggestion for a script (actually for my girlfriend
who
is doing a degree in Comp. Sci in USA). She has a subject on Sys Admin. on Linux :) and on my last trip to USA I installed her a RedHat box at home since they use RH at Uni. , helped her
a
lot with some other exams on basic sys admin in Linux, inst. etc but I am nowhere with scripting. So here we go the assignment in full :
- Write the AUFF (Add User From File) script.
- This script should take a filename as a command line parameter.
- This file should contain all of the "standard" options for the add user
command. 4. You get to decide the format. 5. You get to document the script. 6. You get to write a "man" document supporting your script. 7. Submit a printout of the script, a test file, and your "man" document. 8. Implementing any advanced parsing features will earn you bonus points. (optional)
Sorry for the long list and any help or suggestions greatly appreciated.
I'm back to College now in Ipswich and again as always if someone needs
some
Linux ISO's and lacks a broadband conn. I am more then happy to burn some fresh ones for any user in the group (for free of course:). I will try to make some of our meetings as I do miss them :)
thanks for your time and hope to see you all again later.
Bamir.
main@lists.alug.org.uk http://www.anglian.lug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
On Sat, Apr 13, 2002 at 01:15:32AM +0100, CEPi wrote:
Greetings people,
I need some help or suggestion for a script (actually for my girlfriend who is doing a degree in Comp. Sci in USA). She has a subject on Sys Admin. on Linux :) and on my last trip to USA I installed her a RedHat box at home since they use RH at Uni. , helped her a lot with some other exams on basic sys admin in Linux, inst. etc but I am nowhere with scripting. So here we go the assignment in full :
- Write the AUFF (Add User From File) script.
- This script should take a filename as a command line parameter.
- This file should contain all of the "standard" options for the add user
command. 4. You get to decide the format. 5. You get to document the script. 6. You get to write a "man" document supporting your script. 7. Submit a printout of the script, a test file, and your "man" document. 8. Implementing any advanced parsing features will earn you bonus points. (optional)
Sorry for the long list and any help or suggestions greatly appreciated.
OK, I guess you don't actually want the script written for you - but how about she does something that her college might actually be able to use at a later date... eg pay a visit to the campus admin department and find out what type of format they store their undergraduate admissions data in - then write a script (perhaps Perl?) that would extract the data from that list and add users nicely to the system from it, generating appropriate usernames for all, and perhaps dumping a username/password file that they can easily import back into the main database... She can probably use CPAN modules for the crunching - the rest would only be a few dozen lines - if that...
chris.
ps... ADSL in Ipswich? You lucky sod... I don't think we'll ever have it out here at Eastbridge...
On Sat, 13 Apr 2002, CEPi wrote:
Greetings people, So here we go the assignment in full :
- Write the AUFF (Add User From File) script.
- This script should take a filename as a command line parameter.
- This file should contain all of the "standard" options for the add user
command. 4. You get to decide the format. 5. You get to document the script. 6. You get to write a "man" document supporting your script. 7. Submit a printout of the script, a test file, and your "man" document. 8. Implementing any advanced parsing features will earn you bonus points. (optional)
Sorry for the long list and any help or suggestions greatly appreciated.
Why reinvent the wheel? if you are allowed to use what ever format for the file you want just user the existing /etc/passwd format the script could be as simple as
adduserscript newuser
#!/usr/bash cat /etc/passwd $1 > tmp_file mv tmp_file /etc/passwd #this will create the user with all except the creating of the home area #which I will leave as an excersise for the reader, but you can parse #the file with awk to get the location out, then just mkdir what that #is.
I'm back to College now in Ipswich and again as always if someone needs some Linux ISO's and lacks a broadband conn. I am more then happy to burn some fresh ones for any user in the group (for free of course:). I will try to make some of our meetings as I do miss them :)
You poor sole :o)
thanks for your time and hope to see you all again later.
Np. Anything to avoid the work I should be doing!
D
Bamir.