You are migrating from DOS/Windows batch files and want to emulate the DOS
pause command.
Solution
To do that, use the read -p
command in a function:
pause ()
{
read -p 'Press any key when ready...'
}
Discussion
The -p option followed by a
string argument prints the string before reading input. In this case the
string is the same as the DOS pause
command’s output.