I got this error
bash: syntax error near unexpected token; while running this line:
while; do; clear; tree .git; sleep 1; done
I got this line from this video
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 (
while, which defines the condition (
: is the same as
true, it always succeeds).
See the looping constructs section of the Bash manual for details.