Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 0 1 ( 1 5 points ) Task 0 2 ( 1 5 points ) Write a Bash script that takes an unspecified (
Task points Task points
Write a Bash script that takes an unspecified unlimited number of commandline arguments
parameters where each represents a filename. The script must iterate over each given
filename, check to see if the file exists, and if it does, display the number of lines in the file. If the
file does not exist, an appropriate error message should be displayed.
Use the shift command to allow for an unlimited number of filenames to be provided as
arguments.
In addition, if the script is run with no arguments provided, it should display a message to the
user with a hint as to how the command should be run sample syntax of the command usage
Here is a screenshot of the expected behavior, testing all scenarios described above.
Write a Bash script that accepts an operator abbreviation and a list of integers as command line
argument parameters and performs the operation on the list of integers. The script should be
able to handle addition, subtraction, multiplication, division, exponentiation, and modulo.
Use a loop and the shift command to allow for an unlimited number of integers to be provided
as arguments.
A usage hint message must be displayed if the user enters no arguments and an error message
must be displayed if the user enters invalid arguments.
Here is a screenshot of the expected behavior, testing all scenarios described above. Replicate
this functionality in your script, including the formatting and outputs of all messages.
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