Difference between revisions of "OPS435 Lab 7 - Bash"

From CDOT Wiki
Jump to: navigation, search
(Created page with 'Create an array with every lowercase letter of the alphabet as an element, 25 total. You may hard-code the values in your script. Write a function that will receive as a paramet…')
 
m (Andrew moved page OPS435 Lab 7 to OPS435 Lab 7 - Bash)
 
(No difference)

Latest revision as of 12:31, 22 August 2017

Create an array with every lowercase letter of the alphabet as an element, 25 total. You may hard-code the values in your script.

Write a function that will receive as a parameter a random number between 0 and 24, and will print to the terminal the first letters from the array, but in uppercase.

If the number is 0 - it will print A. If the number is 5 - it will print ABCDE. If the parameter is 24 - it will print the entire alphabet.

You can use the modulus operator and the $RANDOM environment variable to get the random number you need.