'unix script file not found when attempting to run ./autogen.sh
I am trying to build espeak-NG https://github.com/espeak-ng/espeak-ng/blob/master/docs/building.md on a laptop with Windows 10 and currently trying to implement the prereq step of installing 'the pcaudiolib project checked out to src (as src/pcaudiolib).' - I cloned pcaudiolib https://github.com/espeak-ng/pcaudiolib to the src folder in espeak-ng and attempted to run ./autogen.sh in WSL, resulting in the following:
root@DESKTOP-CLS8BP6:/mnt/c/users/lenovo/desktop/espeak-ng/src/pcaudiolib# ./autogen.sh
-bash: ./autogen.sh: /bin/sh^M: bad interpreter: No such file or directory
When I use ls to check the contents of the directory, autogen.sh is clearly there:
root@DESKTOP-CLS8BP6:/mnt/c/users/lenovo/desktop/espeak-ng/src/pcaudiolib# ls
AUTHORS autogen.sh CHANGELOG.md configure.ac COPYING Makefile.am README.md src
What's going on?
Solution 1:[1]
From the comments, it's apparent that you have a script with DOS-style CRLF line-endings that "confuse" Linux/WSL apps/shells/etc., since they expect Unix/Linux LF-only line-endings.
This might have been caused during the checkout. You checked out the repo to your Windows desktop (/mnt/c/users/lenovo/desktop/), so I'm assuming you did it with Windows git.
Typically, you'll want to stick with the Linux tools (git, your editor, etc.) when working with code in WSL.
Attempting to clean up every potentially impacted file manually is probably not the best option.
Try this:
Start in your WSL distribution. I'm assuming this is Ubuntu, but it probably doesn't matter unless you need additional packages.
mkdir ~/src
cd ~/src
git clone https://github.com/espeak-ng/espeak-ng.git
cd espeak-ng
./autogen.sh
That should avoid the mixture of Linux/Windows-DOS style line-endings.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | NotTheDr01ds |
