
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,
- Bash Hello World! Script Tutorial
- How to run bash command in background
- How to create new user account in Windows bash
- How to Compare Strings in Bash
- Bash: Allow Command to Fail without exiting Script
- Fix bash: script.sh: Permission denied Error
- Bash getopts Command Example
- How to fix bash ping command not found error
- How to add NewLine Character in Bash Script String
- How to Echo Bash Command to a File
- Bash Command to Find String in a File
- How to open new Terminal using Bash Command
- Bash How to Save Output of a Command to a Variable
- Download a SSL Certificate from a URL in Terminal
- Bash Command to Check IP Address
- Know Bash shell version command
- Bash Command To Check If File Exists
- How to run a Command in Bash Script
- How to Compare two Files in Bash Shell
- How to check if a variable is set in Bash Script or Not
- Convert String from uppercase to lowercase in Bash
- How to see Created Accessed Modified and Changed dates of a file using bash terminal command
- Bash Command To Get Current Time
- Bash command to List Files
- Fix: bash: syntax error near unexpected token
More Posts:
- How to Clear All Cells Output in Jupyter Notebook - Python
- How to Convert Python String to DateTime Object - Python
- How to know if someone has read your WhatsApp message - WhatsApp
- How to turn off Facebook autoplay videos on timeline - Facebook
- Copy file from one directory to other in Php - PHP
- Java JDBC: Insert Java 8 LocalDate and Time using PreparedStatement - Java
- Fix Git: Warning: could not find UI helper GitHub.UI on Windows - Git
- Read file from Windows CMD (Command Line) - Windows