Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Challenge Lab: Each Challenge Lab is worth 2 0 points. 1 ) Create a script called week 9 . sh with a text editor. 2

Challenge Lab: Each Challenge Lab is worth 20 points.
1) Create a script called week9.sh with a text editor.
2) You MUST make the script file week9.sh executable.
3) Your script MUST use a #!/bin/bash or #!/bin/sh as the first line of the script to
determine what shell is to be used to execute the script.
NOTE: If your script does NOT execute, check your PATH environment variable. It
should have been updated in Week 3 Lab 1 of the semester.
4) Fully comment the script where needed.
5) Your output file will be called week9ch.out.
6) You MUST have a function in the week9.sh script to display your student header
information in the week9ch.out file using > and >> to redirect the output and
information shown below. Example:
*******************************************
* Brent Fulton
* Username: student name show using one of the methods learned
* Date: current date and time using `date`
* Assignment: Week 9 Challenge Lab
*******************************************
7) Make sure the output is neat and use extra echo commands to insert lines into the
output for easier reading.
8) Use blank lines in the script for easier reading in the script as well.
9) 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 week9ch.out file.
b. Use the echo commands below to create a visual separator in the week9ch.out
file.
echo >> week9ch.out
echo >> week9ch.out
c. Your script must clear the screen and ask for a directory name to create. (This will
NOT appear in the week9ch.out file, only on the screen) Read in the response
and use that variable with the mkdir command for the following item.
d. Create a directory using the directory name from above.
e. Use the cd command to change to the directory name from above.
f. Use the touch command to create 3 files called file1, file2 and file3.
g. Change the permissions on the files as follows:
file1600
file2622
file3700
h. Set the Sticky Bit on file1.
i. List the directory files in reverse alphabetical order AND use the long listing
format to show all file details and permissions. This MUST be in your
week9ch.out file.
j. Use the cd command to change back to your home directory.
k. Remove the directory and all files that were created using the variable that
contains the directory name from above.

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions