提问人:Mr.Transistor 提问时间:7/8/2022 最后编辑:Michael M.Mr.Transistor 更新时间:10/25/2022 访问量:79
在尝试在 Shell bash 中打印带引号的行时查找匹配的 '“' 时出现意外的 EOF
unexpected EOF while looking for matching `"' while trying to print a quoted line in Shell bash
问:
我想打印以下行,但我需要这一行:
export PATH=/local/Miniconda3/bin:$PATH >> ~/.bashrc; /local/Miniconda3/bin/python3 scripts/DNAscan.py ${var}
要引用。为了实现这一点,我使用了\“,但我收到以下错误:
unexpected EOF while looking for matching `"'
这是命令:
"${comand} bash -c \"export PATH=/local/Miniconda3/bin:$PATH >> ~/.bashrc; /local/Miniconda3/bin/python3 scripts/DNAscan.py ${var}\""
答:
0赞
Gil Gottesman
7/11/2022
#1
我不确定您的命令出了什么问题,但想指出变量“comand”和“var”都在解析中,如果这不是您的意图,请考虑使用单引号“ '或用反斜杠”\“转义字符串中的”$“符号。
上一个:容器日期不会在入口点脚本中更新
下一个:Bash 循环到文件末尾
评论
export PATH=/local/Miniconda3/bin:$PATH >> ~/.bashrc
scripts/DNSscan.py