Good day Rich!
No, the first attempt was unsuccessful (which I had done prior to posting). I think I might know why, though.
Here's a basic skeleton of what's being done. (The actual script is about 3 pages long, otherwise I'd post the original)
#!/bin/sh
## Some prep code to clean up from the last time the program was run
...
## A bunch of utility functions relating to parsing text, downloading files, etc.
...
my_function()
{
# This function takes anywhere between 1 and 10 seconds to complete
# depending on the size of the extension being worked on and the number
# of dependencies it has. This function "has" to complete, otherwise it will
# likely leave files mounted/locked, partially written, etc. (gets messy)
sleep 5
}
if [ -t 0 ]; then stty -echo -icrnl -icanon time 0 min 0; fi
exts=`cat /path/to/extension/list/filename.txt`
for ext in $exts
do
# Check keypress through cat
keypress="`cat`"; if [ ! "x$keypress" == "x"; then break; fi
# Call above function to process the next extension
my_function $ext
done
if [ -t 0 ]; then stty sane; fi
echo; echo "Script Ended Cleanly"
NOTE: I just went back to the first test script and it failed... until I held down the space-bar, which then was detected. As assumed, there's no keyboard "buffer" thus when detecting keys using redirection, the detection (ie: with "cat" in this case) has to be done at the exact instance the key is pressed or the loop testing for a keypress must be 'x' number of times per second so it doesn't "miss" the pressed key.
For example, let's say I was extracting a couple dozen files. I have to call outside the script (ie: tar -zxf) where during the time the file is decompressing, you can "key-press" all you'd like and it won't be seen when control gets back to the calling script.
[scratches one's head and murmurs "...hmmmm..."]