What does the semicolon do when it is run in a bash command?

前端 未结 3 782
既然无缘
既然无缘 2020-12-19 17:28

For example, when running

echo a; echo b

in the terminal, its output is:

a
b

It seems to me that the semi

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-19 17:53

    It's a statement separator. You could also try

    sleep 1; echo a
    

    which will wait one second and then display a. As would

    sleep 1 && echo a
    

提交回复
热议问题