How do I pause my shell script for a second before continuing?

后端 未结 10 2098
借酒劲吻你
借酒劲吻你 2020-11-30 16:26

I have only found how to wait for user input. However, I only want to pause so that my while true doesn\'t crash my computer.

I tried pause(1)

10条回答
  •  萌比男神i
    2020-11-30 16:47

    I realize that I'm a bit late with this, but you can also call sleep and pass the disired time in. For example, If I wanted to wait for 3 seconds I can do:

    /bin/sleep 3
    

    4 seconds would look like this:

    /bin/sleep 4
    

提交回复
热议问题