Chest Rockwell asked:
I’m writing a shell script for class that needs to prompt the user to enter a subdirectory, If their entry is valid, it will display the contents of that directory. If it is invalid, it will throw an error message and exit.
I’m writing a shell script for class that needs to prompt the user to enter a subdirectory, If their entry is valid, it will display the contents of that directory. If it is invalid, it will throw an error message and exit.
How can I make the script check if their entry is valid without having to program each and every directory into the script?

