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

后端 未结 10 2159
借酒劲吻你
借酒劲吻你 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条回答
  •  长情又很酷
    2020-11-30 16:46

    use trap to pause and check command line (in color using tput) before running it

    trap 'tput setaf 1;tput bold;echo $BASH_COMMAND;read;tput init' DEBUG
    

    press any key to continue

    use with set -x to debug command line

提交回复
热议问题