What is the Linux equivalent to DOS pause?

前端 未结 9 522
猫巷女王i
猫巷女王i 2020-11-30 16:15

I have a Bash shell script in which I would like to pause execution until the user presses a key. In DOS, this is easily accomplished with the \"pause\" command. Is there a

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 16:59

    read without any parameters will only continue if you press enter. The DOS pause command will continue if you press any key. Use read –n1 if you want this behaviour.

提交回复
热议问题