LINUX bash scripts

1. Create a text file called "datafile". Each entry consists of fields separated by colons. The fields are as follows:

a. First and Last name

b. Phone Number

c. Address

d. Birth date

e. Salary

Create a script called "lookup" that will do the following:

a. Contain a comment section with the script name, your name, the date, and the reason for writing this script. The reason for writing this script is to display datafile in sorted order.

b. Sort "datafile" by last names.

c. Show the user the contents of "datafile".

d. Tell the user the number of entries in the file.

Note: Try the -x and -v options for debugging your script.

2. Modify the "lookup" script above to ask the user if he or she would like to add an entry to datafile. If the answer is yes or y:

a. 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".

b. 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.

3. The above "lookup" script depends on "datafile" in order to run. In the "lookup" script, check to see if the "datafile" exists and if it is readable and writable. Add a menu to the "lookup" script to resemble the following:

[1] Add entry

[2] Delete entry

[3] View entry

[4] Exit

Write a function to handle each of the items in the menu. After the user has selected a valid entry, and the function has completed, ask if the user would like to see the menu again. If an invalid entry is entered, the program should print:

"Invalid entry, try again."

and the menu will be redisplayed.

You already have the Add entry part of the script written. The Add entry routine should now include code that will check to see if the name is already in the datafile and if it is, tell the user so. If the name is not there, add the new entry.

Now write the code for the Delete entry, View entry, and Exit functions. Each 'function' should be contained inside a bash function which gets invoked upon the user selection.

The Delete part of the script should first check to see if the entry exists before trying to remove it. If it does, notify the user; otherwise, remove the entry and tell the user you removed it. On exit, make sure that you use a digit to represent the appropriate exit status.

Beceriler: Linux, Kabuk Betiği, Bash Scripting

Müşteri Hakkında:
( 4 değerlendirme ) South Plainfield, United States

Proje NO: #32389018



Hi I have years of experience in shell script and I love dealing with data from different sources (text or databases). I did many script like your project, so contact me so I can start quickly and finish early Thank Daha Fazla

1 gün içinde %selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% USD
(1 Yorum)

Bu iş için 3 freelancer ortalamada $52 teklif veriyor


Hello. I went through the requirements and I'm willing to code the script for you and properly implement all of the functionality as described. Given the level of complexity and amount of testing required, I would need Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(78 Değerlendirme)
(0 Değerlendirme)