Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bash assistance needed! I need help with parts 3a. and 3b. I already have 2a and 2b completed 2. Now cd to your work directory

Bash assistance needed! I need help with parts 3a. and 3b.

I already have 2a and 2b completed

image text in transcribed

2. Now cd to your work directory you created in assignment #1. Write a bash script to: a. Create the following output Enter User's Full Name [Make sure to enter AA 99 pattern job location, eg: BX56, CR91] Enter User's Manager Code : No need to have data validation code in your script. Always enter the exact patterns shown above. Then Run the script, read input and print the result on screen. (Get a screen dump) b. Add more code to the above (a.) script to pipe the output (i.e. user's information) to a file name with the pattern firstname_lastname.usr and save that file in the test_users directory created above. Hints: i.e, if the user full name is John Jacob, a file named John_Jacob.usr must be created and his Full Name, User ID, Job Location and Manager Code must go into that file. Then, if you run the program again, this time you enter Mary Rivera as the full name. Then a file named Mary_Rivera.usr must be created for that user and her Full Name, User ID, Job Location and Manager code must go to Mary_Rivera.usr file. Basically, each user's information goes into that user's own file name. If you enter n users, then n number of files must be created, one per user. As you can see the file name pattern is firstname_lastname.usr. But the actual file names are, have explained above. [Test with at least 2 users. Then Get a screen dump of the test_users directory]. 3. Write a bash script to (Note, you are using the user files you created in 2b in this question) a. Read a file name with the pattern firstname_lastname.usr and then read that file from the test_users directory and echo that user's information from the file. [get minimum of 2 user screen dumps] b. If the entered file name is not existing in the test_users directory echo a message "file : does not exists". [Test it out by entering a non-existing file name and get a screen dump of the result] as 2. Now cd to your work directory you created in assignment #1. Write a bash script to: a. Create the following output Enter User's Full Name [Make sure to enter AA 99 pattern job location, eg: BX56, CR91] Enter User's Manager Code : No need to have data validation code in your script. Always enter the exact patterns shown above. Then Run the script, read input and print the result on screen. (Get a screen dump) b. Add more code to the above (a.) script to pipe the output (i.e. user's information) to a file name with the pattern firstname_lastname.usr and save that file in the test_users directory created above. Hints: i.e, if the user full name is John Jacob, a file named John_Jacob.usr must be created and his Full Name, User ID, Job Location and Manager Code must go into that file. Then, if you run the program again, this time you enter Mary Rivera as the full name. Then a file named Mary_Rivera.usr must be created for that user and her Full Name, User ID, Job Location and Manager code must go to Mary_Rivera.usr file. Basically, each user's information goes into that user's own file name. If you enter n users, then n number of files must be created, one per user. As you can see the file name pattern is firstname_lastname.usr. But the actual file names are, have explained above. [Test with at least 2 users. Then Get a screen dump of the test_users directory]. 3. Write a bash script to (Note, you are using the user files you created in 2b in this question) a. Read a file name with the pattern firstname_lastname.usr and then read that file from the test_users directory and echo that user's information from the file. [get minimum of 2 user screen dumps] b. If the entered file name is not existing in the test_users directory echo a message "file : does not exists". [Test it out by entering a non-existing file name and get a screen dump of the result] as

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions