LAB 57: CONDITIONAL STATEMENTS
Write a script called checking that will do the following: Take a command-line argument, a user's login name. Test to see if a command-line argument was provided. Check to see if the user is in the /etc/passwd file. If so, will print
Found <user> in the /etc/passwd file.
Otherwise, will print
No such user on our system.
In the lookup script from Lab 56, ask the user if he or she would like to add an entry to datafile. If the answer is yes or y: Prompt the user for a new name, phone number, address, birth date, and salary. Each item will be stored in a separate variable. You will provide the colons between the fields and append the information to the datafile. Sort the file by last names. Tell the user you added the entry, and show him or her the line preceded by the line number.
|