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
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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.