For loop in Cygwin bash shell followed by “>”

前端 未结 2 640
日久生厌
日久生厌 2021-01-15 20:59

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

2条回答
  •  轮回少年
    2021-01-15 21:30

    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
    

提交回复
热议问题