Originally Posted by David the H.
I'm not sure I quite understand what you're asking. Reading input from what, into what? Using what? And your title doesn't seem to match your description. Care to give us a real example of what you want to do?
Are you talking about the shell read built-in? There's nothing special about enter or spaces there. All the enter button does is send a newline character into the buffer, and read by default terminates on newline. But you can set the -d option to terminate on some other character instead.
Firstly apologies for not making my question clear, so I want my Bash shell script to ask the user to enter the first "Character" of a file name (in [a-zA-Z0-9]) to search ( find -L ./"$filename") or else press ENTER to list all files in my "Restore" directory. Is this possible as in;
"Press Enter to list full directory of restores or just enter the first letter of filename:"
if [ $input = [a-zA-Z0-9] ]
find -L ./"$input"
[ $input = [<ENTER KEY>]
ls "/full directory of restores"
Thanks in advance for help...