1

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

1
  • autogen.sh is an sh script, not a bash script. What happens if you run sh autogen.sh?
    – Geremia
    Commented Aug 30, 2017 at 5:09

3 Answers 3

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

1

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.

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.