bash-hackers-wiki/docs/snipplets/pause_command.md

16 lines
504 B
Markdown
Raw Normal View History

2023-07-05 11:33:45 +02:00
# Pausing a script (like MSDOS pause command)
\-\-\-- dataentry snipplet \-\-\-- snipplet_tags: terminal, pause, input
LastUpdate_dt: 2010-07-31 Contributors: Jan Schampera type: snipplet
------------------------------------------------------------------------
From the [example section of the read
command](/commands/builtin/read#examples), something that acts similar
to the MSDOS `pause` command:
pause() {
local dummy
read -s -r -p "Press any key to continue..." -n 1 dummy
}