Can't Run; Help With Bash

I’m running “Bash on Ubuntu on Windows” on Windows 10 since Cygwin wasn’t working. I’ve made an aws account and a user with administrative privileges. I have anaconda installed and it is part of my PATH, using Python 3. I also have Python 2 installed separately. I successfully ran “pip install awscli.” The “aws configure” command works, and I’m able to log in with the user and secret key credentials.

But then I tried running the “” script…

root@DESKTOP-ADR2SDQ:/mnt/c/Users/Richard# bash line 4: $’\r’: command not found line 9: syntax error near unexpected token elif' ' line 9:elif [ $region = “eu-west-1” ]; then

Someone else mentioned this problem here, but it doesn’t look like a solution was found. Just a recommendation to start over, which I did, and I have no idea if that did anything. I couldn’t even run the “rm ~/.ssh/aws-key.pem” since that file didn’t exist.

In case it’s helpful, “which python” and “which pip” return these results…

$ which python
$ which pip

Anyone know what I should do?

I’m very new to bash and have been googling this issue for days to no avail. I’d also appreciate having good beginner resources for learning the how/why of bash. Like, where is “/mnt/c/Users/…” on my computer?

Try this Setup problems: AWS

Had the same problem, its because of the End Of Line (EOL) characters that differs between Windows and Linux.

The following link explains how to auto-convert it using notepad++:

After doing so I was able to run and connect to aws server.
However I did not manage to run - running it did not raised any errors, but it did not do anything as well - please let me know if you could make it work.

When comparing and I’ve noticed that the file has ‘cat’ command in the first line, which does not appear in After removing that command I was able to connect to a t2 instance.

instead of use example:

wget ""

In my case I am now stuck exactly at this point.
wget “” <==== This worked well.
bash <===
This gives following error line 7: syntax error near unexpected token newline' line 7:'
Thanks so much

To @shulyalkar1 line 7: syntax error near unexpected token `newline’
The message means that maybe you download the .html file of “”, so it certainly can’t work.

You can try to download from this link by typing

And don’t forget to download another file, because it will be called by

Hope it will help you !