docker - exec:不存在(没有这样的文件或目录)
问题描述
我正在将 WSL 与 docker 一起使用(具有复杂的 pandoc 配置,带有乳胶、python 和 pandoc-filters)并尝试使用长命令--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(可能不需要,但我从这里得到了提示):
#!/bin/sh
python3 filters/the_filter.py $@
谷歌搜索错误显示了很多 GitHub 问题,但没有关于堆栈溢出的明确解释。
解决方案
事实证明,我的.sh
文件有 Windows 行结尾:\r\n
. 我假设系统正在尝试查找/bin/sh\r
,但错误消息没有解释它。
使用 更正行尾dos2unix filters/the_filter.sh
,我能够摆脱错误。
以下是相关问题的更多详细信息。
推荐阅读
- python - next() 和 list() 中的每一个都以不同的方式迭代具有可变对象的生成器
- botframework - 在 QnA Maker 中使用多个 StrictFilter
- zebra-printers - 如何在此脚本中硬编码 Zebra 标签替换?
- firebase - 无法订阅 combineLatest 的结果
- excel - 使用 VBA 对不同选项卡中的不同数据进行排序和删除
- mobile-safari - 意外缩放 PWA 中的方向更改,但不是移动 safari iOS
- mysql - 使用 MYSQL 在同一查询 NODE JS 中选择和插入
- android - 约束布局中的渲染错误
- regex - 如何编写正则表达式以匹配 IP 地址的第三个八位字节
- mysql - 尽管存在主键,但表是只读的