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 cislinux.hfccedu
This lab will Challenge you and your recall of the cislinux.hfccedu lab work for the week.
Challenge Lab: Each Challenge Lab is worth points.
Create a script called weeksh with a text editor.
Fully comment the script where needed.
Your output file will be called weekprintf.out.
You MUST have a function in the weeksh script to display your student header
information in the weekprintf.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 Challenge Lab
Make sure the output is neat and use extra echo commands to insert lines into the
output for easier reading.
Use blank lines in the script for easier reading in the script as well.
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 weekprintf.out file.
b Use the echo commands below to create a visual separator in the
weekprintf.out file.
echo weekprintf.out
echo weekprintf.out
c Your script must clear the screen and ask for a SYSTEM username to
process. This will NOT appear in the weekprintf.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 etcpasswd 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 etcpasswd file, have your script add the following to the
weekprintf.out file:
i Name: operator
Password: x
Userid:
Groupid:
Description: operator
Home Directory: root
Default Shell: sbinnologin
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
