I am using a script to manage stuff on external dives. At the end I want to give the user the option to leave or dismount the drives. I'd like to add a timeout and use the second option (do nothing) if the user has not responded.
I am fairly new to Linux and the References I have found so far are way too cryptic for my current level of linux-ness. It seems the Reference writers assume everyone is already fluent in Linux. :)
How do I add a timeout to this or a better way of doing this with a timeout and default action?
note: "myDrives" is my own program to handle the closing of files etc and dismount
echo "Do you want to un-Mount the External Drives?" echo "" select yn in "yes" "no"; do case $yn in yes ) sudo myDrives --unmount; break;; no ) break;; esac done kill -9 $PPID