Skip to main content
Tiny addition for clarity
Source Link
Kusalananda
  • 356.2k
  • 42
  • 737
  • 1.1k

The video shows

while :
do
    clear
    tree .git
    sleep 1
done

Running that as-is will work. If you want to put all the commands on a single line, you need to write it as

while :; do clear; tree .git; sleep 1; done

You can’t separate do from the following command with ;, and you need the colon (:) following while, which defines the condition (: is the same as true, it always succeeds).

See the looping constructs section of the Bash manual for details.

The video shows

while :
do
    clear
    tree .git
    sleep 1
done

Running that as-is will work. If you want to put all the commands on a single line, you need to write it as

while :; do clear; tree .git; sleep 1; done

You can’t separate do from the following command, and you need the colon (:) following while, which defines the condition (: is the same as true, it always succeeds).

See the looping constructs section of the Bash manual for details.

The video shows

while :
do
    clear
    tree .git
    sleep 1
done

Running that as-is will work. If you want to put all the commands on a single line, you need to write it as

while :; do clear; tree .git; sleep 1; done

You can’t separate do from the following command with ;, and you need the colon (:) following while, which defines the condition (: is the same as true, it always succeeds).

See the looping constructs section of the Bash manual for details.

added 181 characters in body
Source Link
Stephen Kitt
  • 483.6k
  • 60
  • 1.2k
  • 1.4k

The video shows

while :
do
    clear
    tree .git
    sleep 1
done

Running that as-is will work. If you want to put all the commands on a single line, you need to write it as

while :; do clear; tree .git; sleep 1; done

You can’t separate do from the following command, and you need the colon (:) following while, which defines the condition (: is the same as true, it always succeeds).

See the looping constructs section of the Bash manual for details.

The video shows

while :
do
    clear
    tree .git
    sleep 1
done

Running that as-is will work. If you want to put all the commands on a single line, you need to write it as

while :; do clear; tree .git; sleep 1; done

You can’t separate do from the following command, and you need the colon (:) following while, which defines the condition (: is the same as true, it always succeeds).

The video shows

while :
do
    clear
    tree .git
    sleep 1
done

Running that as-is will work. If you want to put all the commands on a single line, you need to write it as

while :; do clear; tree .git; sleep 1; done

You can’t separate do from the following command, and you need the colon (:) following while, which defines the condition (: is the same as true, it always succeeds).

See the looping constructs section of the Bash manual for details.

Source Link
Stephen Kitt
  • 483.6k
  • 60
  • 1.2k
  • 1.4k

The video shows

while :
do
    clear
    tree .git
    sleep 1
done

Running that as-is will work. If you want to put all the commands on a single line, you need to write it as

while :; do clear; tree .git; sleep 1; done

You can’t separate do from the following command, and you need the colon (:) following while, which defines the condition (: is the same as true, it always succeeds).