In the previous class, we created a flat-file database called "ody_employees.dat" which was used to hold
In the previous class, we created a flat-file database called "ody_employees.dat" which was used to hold certain specific user information for our machine. Namely, that file held *UNIX user name *Full name of the user *Comma separated list of groups they were a part of *Their phone number *Their office number
Changed: 3c8,27
dave:Dave Bowman:Sales:661-3247:236
The format of the lines in this file were as follows UNAME:FULL NAME:GROUP(S):PHONE:OFFICE
An example entry is as follows: dave:Dave Bowman:Sales:661-3247:236
Write a shell script that takes entries and adds a line to this flat file database. Call this shell script "empadduser". The script should take the name of the file as an option at the command line: $ empadduser ody_employees.dat
It should then prompt for the entries that will be added to the database: Enter UNIX user name: Enter full name: Enter group(s): Enter phone number: Enter office number:
After the user had entered in the above information, the script should append it in the proper format to the data file given at the command line. The script should then prompt if the user wishes to continue: Do you want to continue (y/n)?
If the user hits "y", then the script should loop back and ask for a new set of user information. The script will continue to run until the user presses "n".
In the previous class, we created a flat-file database called "ody_employees.dat" which was used to hold certain specific user information for our machine. Namely, that file held
UNIX user name
Full name of the user
Comma separated list of groups they were a part of
Their phone number
Their office number
The format of the lines in this file were as follows
UNAME:FULL NAME:GROUP(S):PHONE:OFFICE
An example entry is as follows:
dave:Dave Bowman:Sales:661-3247:236
Write a shell script that takes entries and adds a line to this flat file database. Call this shell script "empadduser". The script should take the name of the file as an option at the command line:
$ empadduser ody_employees.dat
It should then prompt for the entries that will be added to the database:
Enter UNIX user name:
Enter full name:
Enter group(s):
Enter phone number:
Enter office number:
After the user had entered in the above information, the script should append it in the proper format to the data file given at the command line. The script should then prompt if the user wishes to continue:
Do you want to continue (y/n)?
If the user hits "y", then the script should loop back and ask for a new set of user information. The script will continue to run until the user presses "n".