Fuhrmanator
Fuhrmanator

Reputation: 12882

exec: does not exist (No such file or directory)

I'm using WSL with docker (with a complex pandoc configuration with latex, python and pandoc-filters) and trying a long command with --filter=filters/the_filter.sh that results in an error:

Error running filter filters/the_filter.sh: ./filters/the_filter.sh: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

My filter is a .sh wrapper, mostly to make sure I'm using Python3 (which may not be needed, but I got the hint from here):

#!/bin/sh
python3 filters/the_filter.py $@

Googling the error shows lots of GitHub issues, but no definitive explanation on Stack overflow.

Upvotes: 3

Views: 1429

Answers (1)

Fuhrmanator
Fuhrmanator

Reputation: 12882

It turns out that my .sh file had Windows line endings: \r\n. I assume that the system was trying to find /bin/sh\r but the error message is not explaining it.

Correcting the line-endings using dos2unix filters/the_filter.sh, I was able to get rid of the error.

Here are more details of a related problem.

Upvotes: 2

Related Questions