Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No experience with Unix scripting. 1

Status
Not open for further replies.

Sunshine96

Technical User
Sep 16, 2002
2
US
Hello,

I have no experience with Unix scripting or any others. I have just recently taking a Shell programming for Admins. class and I still do not have a clue. I do not have much exposure to using unix like I should. Would you all be able to tell me what would be a good college class to take at a slower paste and or any books to read or reference to. I would really like to give this shell script a good effort.

Reg,
Sunshine96
 
First, realize what UNIX shell scripting is: shell commands. Learn the UNIX command line and you'll be fine. It is really something you just need to practice. A fine way to learn is to use UNIX (or a variant) exclusively. Don't have a UNIX workstation? Need to run windows? Then go have a look at cygwin. . Using this, you can at lease play around with a bash shell or something.
 
Here are a couple links that should help you out:



If you're using the Korn shell, I highly recommend this book:

The New KornShell Command and Programming Language
Morris I. Bolsky, David G. Korn / Paperback / Prentice Hall

We ( also provide a comprehensive online UNIX fundamentals course that has a thorough shell scripting module. Our Internet lab allows you to write and execute shell scripts on our servers from your computer.

Good luck!
 
Live Fire:

I must respectfully disagree with you recommending the New Korn Shell to a beginner. I very much like Bolsky's book, but as a reference - not as a beginner.

Learning the Korn Shell by Bill Rosenblatt (another O'Reilly book) is a much more gentle introduction.

IMO, the very best introduction for learning basic Shell Programming (Hayden Books) by Stephen Kochan and Patrick Wood. (It's an old book, but still viable. You can read 23 sample pages at Amazon.com)

I do like your links - especially the one on Advanced Bash programming. I'm familiar with the author - Mendel Cooper. He definitely knows his stuff.

Regards,

Ed
 
Thank you all for responding. You have given me some great information.

I am currently working on a project with a co-worker and acourse me being new to the unix scripting world. Would someone be able to advise on the following.

1. List1: Extract the legal name of each emplyee from the HR list using these guidlines:

a. Skip middle initials, and titles such as Jr. or III, etc.
b. Convert 'firstname lastname' to lowercase only.
c. Sort the list
d. Check for duplicate name (may be different employees with same first & last names).

2. List2: Extract the user names of every mailbox on usx011:

a. Modify scripts in /root/scripts/sunshine96 (fb2sys and mb2name) to extract a listing of every 'firstname lastname' of the mailboxes on usx011.
b. Convert to 'firstname lastname in lowercase only.
c. Sort the list

3. Use a looping to compare these two lists.
a. Loop1 with a read command to save the first employee name in List1 to Variable1.
b. While still in Loop1, start loop2 to read in the EACH employee name in List2 to Variable2, until a match is found.
c. Compare Variable1 to Variable2.
1. If same, put in Report1 --> The employee's legal name is the same as the mailbox name.
2. If different, put in Report2 --> The employee name spelling is in the HR dtabase, but may be spelled fifferently in OpenMail.
d. Once the first name has been compared and put in either Report1 or Report2, the Loop1 should read the next name record (Step 3.a) and compare it to EACH record in List2 (Step 3.b), continuing until every name is List1 has been compared to every name in List2.

4. After completing and falling out of the loops above, create a loop that compares one name at a time from List2 to EACH name in List1, using similar steps as for above.
a. Only when a name exists in List2, but NOT in List1, put it in Report3 --> These are mailbox names that do not match a legal name of any employee.
b. Determine which names from Report3 are generic accounts.
c. Determine which names from Report3 are contractor accounts.
d. Determine which names from Report3 are active employees who use a different mailbox name thatn the legal name provided by the HR database.

5. Extract, in similar fashion as step 1, the names of employees by Site by Site to be migrated off of USX011.

Your help would be greatly appreciated.

Reg,
Sunshine96
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top