Question: Lab Assignment 3 - 2 Shell Scripts Linux + and LPIC - 1 Show the complete script ( or commands ) and the resulting output
Lab Assignment Shell Scripts Linux and LPIC
Show the complete script or commands and the resulting output for each question.
Modify the following script to insert descriptions of each of the commands.
#binbash
# This is the first example script
date
w
ls l
Write a script which will read the name of a directory and then create it as a sub directory in your home directory.
Complete the following scrpt:
#binbash
# This script lets the user choose to view the date, current users and processes, or the contents of the home directory
# Enter a choice
echo e "What would you like to view:
Today's date d
Current users and process u
Contents of home directory h
Enter choice duhc
# Get the choice complete this section
# The decision construct to process the choice complete this section
# End of Script
Create a directory called Files in your home directory. In the Files directory create five files: Name, Address, State, Zip, and Phone. You can use touch to create the files.
Write a script file which will rename each of the files in directory Files created in question with a txt extension. For example file Name will become Name.txt etc.
Write a script called MakeFunction which creates a function named: CreateDir. The function when called should accept a new directory name as a command line argument and then create the new directory. Note: when executing MakeFunction used the dot command so that the function will be created in the login shell.
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
