To sleep or delay a specified amount of time in a bash script, you can use the sleep
command. This command takes the number of seconds to wait as an argument. For example, to sleep for 5 seconds:
# Sleep for 5 seconds
sleep 5
In some cases, you might need to sleep for a longer duration, in which case, you can specify the number of minutes or hours by converting them to seconds.
For example, to sleep for 5 minutes:
# Sleep for 5 minutes
sleep $((5 * 60))
Or, to sleep for 1 hour:
# Sleep for 1 hour
sleep $((60 * 60))