• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

pause

Bash Any Key

November 29, 2022

Here’s the script to add pauses in your Bash script.

echo "please wait until web page loads ... "
read -p "Press any key to continue... " -n1 -s

echo "please wait until web page loads ... " read -p "Press any key to continue... " -n1 -s

You can also put it inside a function and call it multiple times.

function press_any_key {
  echo "please wait until web page loads ... "
  read -p "Press any key to continue... " -n1 -s
}
press_any_key

function press_any_key { echo "please wait until web page loads ... " read -p "Press any key to continue... " -n1 -s } press_any_key

Filed Under: Linux Tagged With: any, bash, key, pause, press

  • Home
  • About
  • Archives

Copyright © 2023