Question: Write a shell script that accepts no command line arguments. The script reads three integers from the standard input. If the three integers are in

Write a shell script that accepts no command line arguments. The script reads three integers from the standard input. If the three integers are in an ascending order; it prints the median number and quits If the three numbers are not in an ascending order, it displays NO and proceeds to read three integers and repeat until three ascending numbers are read; then it displays the median number and quits.

for example CPU % q22.sh

3 3 4 NO

3 6 2

NO

3 4 5

4

CPU%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!