bash - 意外标记 `$'do\r'' 附近的语法错误
问题描述
谁能告诉我我的程序有什么问题吗?这对我来说似乎正确吗?发送
程序:
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
解决方案
推荐阅读
- xamarin.forms - 将第一个 StackLayout 定位在页面底部 Xamarin.Forms
- c# - For循环异步问题C#
- excel - 从列表中选择默认打印机,而不是硬编码
- python - 使用 python 运行 mapreduce 作业(MRjob)时,命令行上出现意外的参数错误
- javascript - 使用谷歌脚本和 html 模板循环进入项目符号
- python - pip2:ImportError:无法导入名称 RequirementParseError
- ios - 当 options = nil 初始化时,CBCentralManager 的默认警报操作是什么?
- android - 如何在 Android 中使用 Kotlin 添加音效
- python - 在 Pandas 中对带有数字的字符串列进行排序
- javascript - 使用 Selenium 添加 JavaScript 事件监听器会自动触发它