AWS Certified Solutions Architect - Associate (SAA-C02)

Sign Up Free or Log In to participate!

Batch scrips not working

copied from site

!/bin/bash

yum update -y

yum install httpd -y

service httpd start

cd /var/www/html

echo "

Hello Cloud Gurus

" > index.html

does not work

please fix

2 Answers

I just tested it successfully. Can you please provide the error received

#!/bin/bash  
yum update -y  
yum install httpd -y  
service httpd start  
cd /var/www/html  
echo "Hello Cloud Gurus" > index.html

As Ben noticed it works, but you have copied #!/bin/bash without #.

This will make the script not use bash to run the commands and it will fail.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?