Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2) (20 points) Write a Bash shell script named calc.sh that a. Performs addition (+), subtraction (), multiplication (x), and integer division () math b.

image text in transcribed

2) (20 points) Write a Bash shell script named "calc.sh" that a. Performs addition (+), subtraction (), multiplication (x), and integer division () math b. Takes in 2 operands and 1 operator and prints the result. Example: "calc.sh 53" would c. If there are not exactly 3 arguments, or the second argument is not one of the operators in d. If operator is division (/) and second operand is 0, then print error message "error: cannot operations. print "8" and "calc.sh 9/2" would print "4" part (a), or first or third argument is not an integer, print an error message and exit divide by 0" and exit e. Hint: Use case statement

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

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

Students also viewed these Databases questions