BASH take argument if user don't type anything
Hi everyone, i have the following script but as you can see, you need to type "y" or "n" in order to do something, is there any way for the script to send a "y" or a "n" after 10 seconds if the user don't type anything?
Code:
echo " Continue ..." |
From "man read"
Quote:
|
Great, you just gave me an idea. I will try it and post here.
Thanks again. |
This is the final script i had in mind.
Code:
#!/bin/bash |
Your script currently only prompts the user once to continue, yet if 'Y' is chosen a blank prompt will appear again and it may not be obvious to the user that they need to enter something.
Also I am a big believer in not replicating code if possible, so you could optionally do something like: Code:
#!/bin/bash |
All times are GMT -5. The time now is 03:38 AM. |