3

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.

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Hi @Fuhrmanator, did you solve the issue? Not sure, but I think you should accept your own answer.
@Gabriele one must wait two days before accepting one's own answer.
I see, I didn't know :)
When writing a filter with panflute I found that having CRLF line endings in the python filter itself caused this error too.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.