Question: Write a bash script called minor4A.sh that prints a trapezoid with the top-base and height dimensions given from two parameters passed as command line arguments.

Write a bash script called minor4A.sh that prints a trapezoid with the top-base and height dimensions given from two parameters passed as command line arguments. The syntax is as follows: minor4A.sh top-base height The mandatory integral parameter top-base must be greater than 1 and the height must be greater than 0, but can be any reasonable integral value (as long as the terminal supports it). If any of the parameters are less than the required value, you are to display a meaningful error message and terminate the program. If no, two few, or too many arguments, are given, you are to display an appropriate usage statement, such as usage: ./minor4A.sh top-base height, and terminate the program. In this program, you are to draw the appropriate sized trapezoid with the character on all four comers (with leading spaces for the top-base, the correct number of- characters at the top and bottom rows between the'+' characters at the corners, and the '/" or \ characters with the correct number of spaces in between on the intermediate lines. SAMPLE OUTPUT (user input shown in bold): $ /minor4A.sh usage: ./minor4Ash top-base height $ /minor4A.sh 5 3 4 usage: ./minor4A.sh top-base height S /minor4A.sh 1 2 error: top-base () must be > 1 S /minor4A.sh 2 0 error: height (0) must be > 0 S ./minor4A.sh 4 2 S /minor4A.sh 2 1 $ ./minor4A.sh 5 3 $ /minor4A.sh 8 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
