Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Errors running bash script from pandoc filters repo in WSL

I’m trying to run runtests.sh from this repo on my local machine using WSL. First I installed WSL using wsl --install Ubuntu. Then I navigated to my local clone and ran sh runtests.sh. I got the following error:

: not found: 4:

: not found: 7:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

runtests.sh: 8: Syntax error: word unexpected (expecting "do")

I’m not too familiar with bash scripts, and I’m pretty sure this one should work, since it’s part of a reasonably well maintained repo. There has got to be something wrong with how I’m calling the script.

What am I doing wrong here?

>Solution :

Are you attempting to run a shell script with CRLF line endings?

Use file runtests.sh to confirm.

git will checkout files using CRLF line endings on windows if core.autocrlf is true.

Use git config core.autocrlf from the cloning machine (not necessarily the WSL2) to confirm.

To disable this behavior and reset your working directory:

git config core.autocrlf false
git checkout -- .
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading