Now, write a script that uses a parameter to open a file and read the contents of the file into an array. You must do ALL of the steps below, so read carefully.
1. The script accepts one parameter – the name of the file (which may include a path).
2. The script tests to see if the parameter is the name of a file that exists, is readable, and is NOT executable.
a. If it is all of those things, the script proceeds.
b. If it is not, the script prints an error message and then exits. Be sure you test this!
(The steps below only happen if the tests were passed in step 2)
3. Use a loop to read in each line of the file.
a. Before the loop starts, create a list variable.
b. Inside the loop, assign each line you read to a different position in the array, starting with position 0.
4. After you have read everything into the array, use another loop to print out the contents of the array.