Answered step by step
Verified Expert Solution
Link Copied!

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 01(15 points) Task 02(15 points)
Write a Bash script that takes an unspecified (unlimited) number of command-line 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.
image text in transcribed

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

More Books

Students also viewed these Databases questions

Question

Brief the importance of span of control and its concepts.

Answered: 1 week ago

Question

What is meant by decentralisation?

Answered: 1 week ago

Question

Describe the new structures for the HRM function. page 676

Answered: 1 week ago