Classnotes | UNIX01 | RecentChanges | Preferences You will now write two Perl scripts that will parse the information in our "ody_employees.dat" file. The first script will take from the command line the name of the employee data file to parse as well as a list of user names to search for. This script will be called "empsearch" and will have the following syntax:
It wil search the employee_data_file for the usernames listed as arguments. When it finds the usernames in the data file, it will display ther pertinent information on them in the following format:
UNIX Name: unix_name
Full Name: full name
Member of Groups: group info
Phone Number: phone
Office Number: office
If more than one user name is entered, it will sequentially run through each and display the above information for every user found. (Extra non-existant credit goes to someone who can make their Perl script report "No Record Found" when a username is not found.)
Next, we will rewrite our lspr and lssales from last time in Perl. Now, we will write an arbitrary one which will search through the groups for any group specified at the command line. Our file will be called lsgroup and will accept the following syntax:
lsgroup group [group ... ]
It will run through each group specified on the command line and will display the following:
Users in "group1"
username1
username2
.....
Users in "group2"
username1
username2
.....
The solutions to these two files can be found here: