繁体   English   中英

为什么在我的 Bash 脚本中出现“意外标记‘完成’附近的语法错误”?

[英]Why do I get "syntax error near unexpected token `done'" in my Bash script?

我有这个 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

PRET = https://github.com/RUB-NDS/PRET

我无法重现此错误。 有效的例子:

$ cat t.sh
while read -r line ; do
  echo $line
done  < t.txt

$ cat t.txt
item1
item2
item3

$ ./t.sh
item1
item2
item3

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM