意外标记'$'do \ r'附近的语法错误

时间:2019-01-04 22:01:06

标签: bash

有人可以告诉我我的程序请问出什么问题吗?对我来说似乎正确吗? Tx

程序:

foo = "https://www.cs.cmu.edu/~rwh/courses/hott/notes/notes_week"
bar = "https://www.cs.cmu.edu/~rwh/courses/hott/notes/notes_week"
for i in {1..12} 
do
    foo = $bar
    foo+="$i"+".pdf"
    wget foo
done

输入:

PS E:\book> wsl ./s.sh

输出:

./s.sh: line 1: foo: command not found
./s.sh: line 2: bar: command not found
./s.sh: line 4: syntax error near unexpected token `$'do\r''
'/s.sh: line 4: `do

0 个答案:

没有答案