我正在将 WSL 与 docker 一起使用(具有包含 Latex、Python 和 pandoc-filters 的复杂 pandoc 配置),并尝试使用 --filter=filters/the_filter.sh
执行长命令,结果是错误:
Error running filter filters/the_filter.sh: ./filters/the_filter.sh: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
我的过滤器是一个 .sh
包装器,主要是为了确保我使用的是 Python3(可能不需要,但我从 here 得到了提示):
#!/bin/sh
python3 filters/the_filter.py $@
Googling the error显示了很多 GitHub 问题,但没有关于 Stack Overflow 的明确解释。
最佳答案
事实证明,我的 .sh
文件具有 Windows 行结尾:\r\n
。
我假设系统试图找到 /bin/sh\r
但错误消息没有解释它。
使用dos2unixfilters/the_filter.sh
更正行结尾,我能够消除错误。
Here是相关问题的更多详细信息。
关于docker - 执行: does not exist (No such file or directory),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66305064/