I am also having problems running setup_p2.sh
I have 2 versions of the script, one that I downloaded via the terminal and one that I from from the github page.
I am running them from the Linux terminal.
Neither of them seem to work.
The first looks as follows:
# Configure a p2.xlarge instance
# get the correct ami
export region=$(aws configure get region)
if [ $region = "us-west-2" ]; then
export ami="ami-bc508adc" # Oregon
elif [ $region = "eu-west-1" ]; then
export ami="ami-b43d1ec7" # Ireland
elif [ $region = "us-east-1" ]; then
export ami="ami-31ecfb26" # Virginia
echo "Only us-west-2 (Oregon), eu-west-1 (Ireland), and us-east-1 (Virginia) are currently supported"
. $(dirname "$0")/setup_instance.sh
The output I get when running the above is:
setup_p2.sh: line 4: $'\r': command not found
setup_p2.sh: line 9: syntax error near unexpected token `elif'
'etup_p2.sh: line 9: `elif [ $region = "eu-west-1" ]; then
The other version that I have is much longer and starts with:
<meta content="width=300, initial-scale=1" name="viewport">
and also fails when running, with the following output:
setup_p2.sh: line 2: syntax error near unexpected token `newline'
setup_p2.sh: line 2: `<!DOCTYPE html>'
I'm very new to shell script. Any help/suggestions would be greatly appreciated.