Question: Challenge Lab for Week 7 cislinux.hfcc . edu This lab will Challenge you and your recall of the cislinux.hfcc . edu lab work for the

Challenge Lab for Week 7 cislinux.hfcc.edu
This lab will Challenge you and your recall of the cislinux.hfcc.edu lab work for the week.
Challenge Lab: Each Challenge Lab is worth 20 points.
1) Create a script called week7.sh with a text editor.
2) Fully comment the script where needed.
3) Your output file will be called week7printf.out.
4) You MUST have a function in the week7.sh script to display your student header
information in the week7printf.out file using > and >> to redirect the output and
information shown below. Example:
*******************************************
* Brent Fulton
* Username: bfulton show using one of the methods learned
* Date: current date and time using `date`
* Assignment: Week 6 Challenge Lab
*******************************************
5) Make sure the output is neat and use extra echo commands to insert lines into the
output for easier reading.
6) Use blank lines in the script for easier reading in the script as well.
7) The script should perform, complete, and show the following information:
a. Function in script should show the student header information as discussed above
in the week7printf.out file.
b. Use the echo commands below to create a visual separator in the
week7printf.out file.
echo >> week7printf.out
echo >> week7printf.out
c. Your script must clear the screen and ask for a SYSTEM username to
process. (This will NOT appear in the week7printf.out file, only on the
screen) Read in the response (must be operator) and use that variable
with the grep command for the following item.
NOTE: Do NOT test this script with root! Since the pattern of root can
be found in multiple locations in the /etc/passwd file, it would produce
strange results.
NOTE: Your script should work with any other username such as mail,
games, apache or ftp as well if you would like to test the script with a
different account. It will of course change the output below; however,
it would be a good test to verify your script is working correctly.
NOTE: Your script MUST use the printf command for the following item!
d. Using the variable from the previous item and grep, cut and printf commands
with the /etc/passwd file, have your script add the following to the
week7printf.out file:
i. Name: operator
Password: x
Userid: 11
Groupid: 0
Description: operator
Home Directory: /root
Default Shell: /sbin/nologin

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!