0

I have a flag on a file

APP_URL=http://localhost

I want to update it to

APP_URL=http://aws.test

I want to overwrite it, I tried

sed -i -e 's/APP_URL=http://localhost/APP_URL=http://aws.test/g' .env

and

sed -i -e 's/APP_URL="http://localhost"/APP_URL="http://aws.test"/g' .env

I kept getting

sed: 1: "s/APP_URL="http://local ...": bad flag in substitute command: 'l'

How would one go about debugging this further?

halfer
  • 19,471
  • 17
  • 87
  • 173
code-8
  • 49,286
  • 91
  • 294
  • 502

1 Answers1

2

You have too many forwardslashes in your command. Either escape the ones in the url with \/ or use a different separator for sed, ie:

sed 's#replace/this/string#with/this/one#g'
Alex Stiff
  • 794
  • 4
  • 12