When I type the following command in a cygwin bash shell:
for i in $(ls) do echo $i done
I get a \">\" asking me to keep typing, as opposed
You need to separate your for, do and done statements.. Try this:
for i in $(ls); do echo $i; done
You can also separate the statements with newlines. For exmaple:
cygwin$ for i in $(ls)
> do
> echo $i
> done
Your for
loop is still waiting for the semicolon or newline that terminates the list of values. So far, your loop with set i
to the list of words produced by ls
, the word do
, the word echo
, the words produced by the expansion of the current value of i
, and the word done
.
The >
is the so-called secondary prompt, which indicates that the shell is still waiting for input to complete the command started by for
.