0

I have a simple bash script that is trying to install apache2 and It is throwing errors that I am not able to comprehend. I can run the command directly on the command line though!

#!/bin/bash

sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install apache2 -y

Output

: not foundh: 2: configec2.sh:
Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
Reading package lists... Done
E: Command line option '
   ' [from -y
   ] is not understood in combination with the other options.
E: Command line option '
   ' [from -y
   ] is not understood in combination with the other options.

any clue?

user269867
  • 2,727
  • 8
  • 39
  • 60

0 Answers0