- Joined
- Jul 16, 2017
- Messages
- 2
- Reaction score
- 0
- Points
- 1
Hi all,
In my script I use the ls command to display the list of files in the directory. I then want the user to choose and input a single file name from the list (using the read command). If they enter a name not listed above I want the terminal to ask them to retype. The files in the directory are not always going to be the same every time the script is run, so the script will have to somehow compare the user input to all files in that directory at that current time. Can I compare input to ls somehow?
Thank you in advance
(P.s. I'm new to this )
In my script I use the ls command to display the list of files in the directory. I then want the user to choose and input a single file name from the list (using the read command). If they enter a name not listed above I want the terminal to ask them to retype. The files in the directory are not always going to be the same every time the script is run, so the script will have to somehow compare the user input to all files in that directory at that current time. Can I compare input to ls somehow?
Thank you in advance
(P.s. I'm new to this )