bash - 为什么在我的 Bash 脚本中出现“意外标记‘完成’附近的语法错误”?
问题描述
我有这个 Bash 脚本:
#!/bin/bash
while read -r line; do
ip="$line"
torify ./PRET/pret.py $ip pjl -q -i ./commands.txt
done < "./potential_bros.txt"
为什么我会收到此错误?
命令.txt=
print ./message.pdf
display Completed
quit
potential_bros.txt = 我的 ip
解决方案
我无法重现此错误。有效的例子:
$ cat t.sh
while read -r line ; do
echo $line
done < t.txt
$ cat t.txt
item1
item2
item3
$ ./t.sh
item1
item2
item3
推荐阅读
- ios - UITapGestureRecognizer 添加到 UIView 类型的屏幕上
- php - PHP Laravel - 使用 LaravelGettext 进行多语言环境路由?
- javascript - 在 Twilio API 上下载 WhatsApp 位置文件
- web-services - 实现自定义 Web 服务后不再使用 platformwebservice
- php - 使用过滤器将 html 添加到 WooCommerce 商店通知
- javascript - 从表单收集数据,在对象中堆叠并使用 Vue 使用 AJAX 发送
- opencv - 如何在 ubuntu 18.04 中正确配置 g++ 与 opecv 的链接?
- python - 在 pandas Dataframe 函数中使用 shift 函数
- html - IE11如何在不提示程序选择器的情况下下载文件
- bash - 将 Bash 命令与 AWS CLI 复制命令相结合