Bash Shell Script Examples

From Free Knowledge Base- The DUCK Project
Revision as of 15:42, 26 June 2014 by Admin (talk | contribs) (Created page with "== Add Pause Prompt In a Shell Script == Use "read". There is no pause command under bash shell. #!/bin/bash echo $1 read -p "Press [Enter] key to continue." The sampl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Add Pause Prompt In a Shell Script

Use "read". There is no pause command under bash shell.

#!/bin/bash
echo $1
read -p "Press [Enter] key to continue."

The sample script above shows what is entered as a command line parameter and then pauses, waiting for the user to press the ENTER key to continue. This creates a PAUSE.