Question
Linux Lab 1.Find where is the bash program located on your system and which version is it? 2.Write a script using your favorite editor. The
Linux Lab
1.Find where is the bash program located on your system and which version is it?
2.Write a script using your favorite editor. The script should display the path to your home directory. Use the cat command to display that script.
3.Add comments in that script and display it to the terminal again.
4.Add information for the users of your script.
5.Change permissions on your script so that you can run it.
6.Run the script in normal mode and in debug mode. It should run without errors.
7.Make errors in your script: see what happens if you misspell commands. Check what the debug comments say about this.
8.Use an if/then/elif/else write a script named days.sh that prints the number of days in the current month. Display it on the terminal by using the cat command then run it to make sure that it works correctly.
9.Write an interactive script that asks for the user's age. If it is equal to or higher than 21, print a message saying that this user is allowed to drink alcohol. If the user's age is below 21, print a message telling the user how many years he or she has to wait before legally being allowed to drink. Display your script on the terminal using the cat command. Run the script and give inputs 15, then 30.
10.Write a script that takes exactly one argument, a directory name. If the number of arguments is more or less than one, print a usage message. If the argument is not a directory, print another message. For the given directory, print the three biggest files and the three files that were most recently modified.
11.Display your script on the terminal using the cat command. Test your script using arguments that cover two user error cases mentioned above. Then run your script with /usr/sbin as the input.
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