Syntax for a single-line Bash infinite while loop

前端 未结 13 1416
长情又很酷
长情又很酷 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 14:45

    You can try this too WARNING: this you should not do but since the question is asking for infinite loop with no end...this is how you could do it.

    while [[ 0 -ne 1 ]]; do echo "it's looping";   sleep 2; done
    

提交回复
热议问题