mirror of
https://github.com/flokoe/bash-hackers-wiki.git
synced 2024-11-01 06:53:05 +01:00
18 lines
442 B
Plaintext
18 lines
442 B
Plaintext
====== 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 [[commands:builtin:read#examples|example section of the read command]], something that acts similar to the MSDOS ''pause'' command:
|
|
|
|
<code>
|
|
pause() {
|
|
local dummy
|
|
read -s -r -p "Press any key to continue..." -n 1 dummy
|
|
}
|
|
</code>
|