You need to use the sleep command to add delay for a specified amount of time. The syntax is as follows:
sleep NUMBER[SUFFIX]
Where SUFFIX may be:
1.s for seconds (the default)
2.m for minutes.
3.h for hours.
4.d for days.
To sleep for 5 seconds, use:
sleep 5
To sleep for 2 mintus, use:
sleep 2m
sleep Command Bash Script Example
#!/bin/bash
echo "Hi, I'm sleeping for 5 seconds..."
sleep 5
echo "all Done."
Sem comentários:
Enviar um comentário