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,824
  • 17
  • 99
  • 186
code-8
  • 54,650
  • 106
  • 352
  • 604

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
  • 844
  • 5
  • 12