Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Purpose: The purpose of this assignment is to write a shell script with the name lab 4 . scr that will run various UNIX commands
Purpose: The purpose of this assignment is to write a shell
script with the name labscr that will run various UNIX
commands and will redirect the output of the commands to
two output files with the filenames labout and labout
Note: The output files labout and labout must be passed
to the script as command line arguments. There should be no
reference to the filenames labout or labout in your script.
Steps listed below should be part of the labscr script file.
All files must be contained within your lab directory.
Your script must contain comments with your name, course
number and your user id
Create a directory with the name lab in your home directory
demonstrating use of the Keyword Shell Variable that contains the
value of your home directory.
Declare the local variable labdir with the value of the pathname
to your lab directory. Declare the GLOBAL variable LABDIR with
the value of the pathname to your lab directory.
Output file labout should contain the output
from the following Unix commands:
List all filenames in the homedavidlab
directory beginning with "host" that were created
on May
Display the value of the shell variable that contains
the search path for executables.
Declare the local variable labvar with the value of the date in
the format mmddyy Use the touch command to create the filename
labtest in your lab directory using the labvar variable as a
file extension. ie labtest
Output file labout should contain the output
from the following Unix commands:
Copy the labreadme file from homedavid to your
lab directory using the labdir variable. List
the file access permissions for all files in your
lab directory.
List variables set in your environment displaying
ONLY the variable labdir and its value.
List all files in your lab directory using the GLOBAL
variable LABDIR
Create a file in your lab directory with the filename labout
that contains the contents of the labout and labout files.
can you give a detailed explanation and include screenshots?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started