Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Bash add pause prompt in a shell script with bash pause command

read -p "Press [Enter] key to start backup..."
read -p "Press any key to resume ..."
## Bash add pause prompt for 5 seconds ##
read -t 5 -p "I am going to wait for 5 seconds only ..."
Comment

pause in bash

#pause 5 second, first method
read -t 5

#pause 5 second, second method
sleep 5s
Comment

pause bash script

function pause(){
 read -s -n 1 -p "Press any key to continue . . ."
 echo ""
}
 
## Pause it ##
pause
 
## rest of script below
Comment

PREVIOUS NEXT
Code Example
Shell :: ubuntu make sh file executable 
Shell :: install oh my zsh linux 
Shell :: dpkg: error processing archive /var/cache/apt/archives/atftpd_0.7.git20210915- 
Shell :: git move changes to new branch 
Shell :: mac terminal hide username 
Shell :: docker make container auto start 
Shell :: debian apt log 
Shell :: list packages linux windows 
Shell :: how to check if docker is installed 
Shell :: ubuntu sources.list path 
Shell :: bash alias function that accepts arguments 
Shell :: stop all docker containers 
Shell :: bash if greater than 
Shell :: powershell script path 
Shell :: copy ssh remote server 
Shell :: install laravel globally ubuntu 
Shell :: ng cli generate component 
Shell :: how to remove v4l2loopback 
Shell :: how do i clone a specific branch in git 
Shell :: pesquisar codigo commit 
Shell :: linux check docker version 
Shell :: maven create project from archetype command line 
Shell :: how to go to a folder in git bash 
Shell :: Ubuntu free ports in use 
Shell :: bittorrent download linux 
Shell :: install openssl 1.0.2 
Shell :: find command in unix 
Shell :: ubuntu spotify 
Shell :: grep nth line 
Shell :: kill a process at a port 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =