Pause Scripts with 'Press Any Key' in Bash, CMD, PowerShell, and macOS
Any-key pause for Bash, CMD, PowerShell, and macOS.
Batch files and shell scripts often need a short wait so a double-clicked window or installer log stays visible. Windows CMD has a dedicated pause command. Unix shells use read.