Syntax for a single-line Bash infinite while loop

前端 未结 13 1383
长情又很酷
长情又很酷 2020-11-29 14:18

I am having trouble coming up with the right combination of semicolons and/or braces. I\'d like to do this, but as a one-liner from the command line:

while [         


        
13条回答
  •  無奈伤痛
    2020-11-29 15:09

    It's also possible to use sleep command in while's condition. Making one-liner looking more clean imho.

    while sleep 2; do echo thinking; done
    

提交回复
热议问题