user54617: 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:


user12321: 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.

user56480: 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

54617: <p>I installed Ubuntu on Windows, then cloned <a href="https://github.com/bitcoin/bitcoin" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin</a> in. </p>

<pre><code>cd bitcoin
./autogen.sh
</code></pre>

<p>Which returned this:</p>

<pre><code>: not foundh: 5: ./autogen.sh:
./autogen.sh: 6: set: Illegal option -
</code></pre>

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

<p>Thanks!</p>

<p>EDIT: Here is a screenshot:</p>

<p><img src="https://i.stack.imgur.com/o5Unv.png" alt="enter image description here"></p>
 12321: <p>This is how I resolved the issue using Git in Windows.  Note that it will reset your local with master.</p>

<pre><code>git config --global core.autocrlf false
git reset --hard origin/master
</code></pre>

<p>I was then able to use the Ubuntu subsystem in Windows to run ./autogen.sh without the error in the OP.</p>
 56480: <p>This means your file has DOS newlines thus, hidden CR characters at the end.
Thus, <code>set -e</code> becomes <code>set -e$'\r'</code> (using bash-specific syntax to represent the CR character), which isn't a valid option.</p>

<p>To fix this, if you have dos2unix installed, you can run:
    <code>dos2unix autogen.sh</code></p>
