Question: The Triangle BASH scripting For this script we are going to take in a number via a command line argument. We are then going to
The Triangle BASH scripting
For this script we are going to take in a number via a command line argument. We are then going to draw a triangle facing right the size of the number the user entered by counting up and then counting back down (See the test cases to get a better picture of what I mean). For this script you will need to
Name This Script: triangle
Take an integer via a command line argument (DO NOT PROMPT THE USER FOR A NUMBER)
If a number is not given when executing the script, error out and alert to the user that they must provide a number. Use exit code 10 if this occurs
Using a for loop, construct the loop that will echo out the spear
Depending on the number you are on, that is what will be echoed out. For Example:
If we are at integer 5. The following will be echoed out: 55555
You will need to nest a loop within a loop. Multiple loops will be required to complete the assignment
Limit the inputted integer to be no bigger than 10. If violated, alert and exit with exit code 20.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
