autogen.sh not working on Ubuntu on Windows

0

I installed Ubuntu on Windows, then cloned https://github.com/bitcoin/bitcoin in.

cd bitcoin
./autogen.sh

Which returned this:

: not foundh: 5: ./autogen.sh:
./autogen.sh: 6: set: Illegal option -

What am I doing wrong here? Have I missed something, or do I need to raise it as an issue on GitHub?

Thanks!

EDIT: Here is a screenshot:

enter image description here

MattyAB

Posted 2017-07-16T18:51:16.783

Reputation: 11

autogen.sh is an sh script, not a bash script. What happens if you run sh autogen.sh?Geremia 2017-08-30T05:09:29.650

Answers

2

This means your file has DOS newlines thus, hidden CR characters at the end. Thus, set -e becomes set -e$'\r' (using bash-specific syntax to represent the CR character), which isn't a valid option.

To fix this, if you have dos2unix installed, you can run: dos2unix autogen.sh

smhaziq

Posted 2017-07-16T18:51:16.783

Reputation: 21

0

I seems that you're in the wrong directory as in the bitcoin directory there is definitely the autogen.sh.

Are you sure you are in the same bitcoin directory that you had just cloned? What does ls (list directory contents) return?

Murch

Posted 2017-07-16T18:51:16.783

Reputation: 41 609

0

This is how I resolved the issue using Git in Windows. Note that it will reset your local with master.

git config --global core.autocrlf false
git reset --hard origin/master

I was then able to use the Ubuntu subsystem in Windows to run ./autogen.sh without the error in the OP.

Gabe

Posted 2017-07-16T18:51:16.783

Reputation: 23