
In order to make the bash script wait for n number of seconds you can make use of the sleep command,
Example:# sleep 3
If you run the above command, it will wait for 3 seconds before you are returned to the prompt.
Bash script Example:#!/bin/bash
#Bash command to wait for seconds
for (( i=1; i<=10; i++ ))
do
echo "Waiting for 5 seconds..."
sleep 5
done
Output:
Sleeping for 5 seconds...
Sleeping for 5 seconds...
...
...
Sleeping for 5 seconds...
#
More Posts related to Bash,
- How to start or open a new bourne-again shell (bash) session on Windows using Command Line CMD
- How to create new user account in Windows bash
- Bash Hello World! Script Tutorial
- How to Compare Strings in Bash
- How to see Created Accessed Modified and Changed dates of a file using bash terminal command
- Command to Sort File In Reverse Order [Unix/Linux/macOS]
- Bash command to wait for seconds
- [fix] bash: ssh: command not found
- bash: netstat: command not found
- Know Bash shell version command
- List all Username and User ID using Bash Command
- How to use Autocomplete and Autosuggestion in Shell Commands
- How to know the current shell you are logged in?
- [Fix] bash: script.sh: /bin/bash^M: bad interpreter: No such file or directory
- 'pwd' is not recognized as an internal or external command, operable program or batch file. [Windows]
- How to Kill a port using bash terminal command?
- How to fix bash ping command not found error
- Install Bash Completion on macOS
- bash get year 2021 calendar
- How to check your IP using bash for Windows?
- Bash For Loop Example
- Fix bash: script.sh: Permission denied Error
More Posts:
- Insert Auto Increment Value using PreparedStatement in Java JDBC - Java
- StringTokenizer in Java with Examples - Java
- Advanced ways to set Custom Settings for a Website on Safari for Mac - MacOS
- How to install XML Tools Plugin Notepad++ - NotepadPlusPlus
- Project JDK is not defined [IntelliJ IDEA] - Java
- Open file using CMD in Notepad++ - NotepadPlusPlus
- Run DynamoDB Local on Docker Container - Docker
- Get Wifi Details : Android Programming - Android