0

I am trying to replace a particular command. CDBFILELOCATION to +DATAC1/vbmtmdppg/ but it doesn't seem to be working. I saw some reference but all they have give is a blank slash example which is hard to understand. Please find the command i am using right now.

sed -i 's/CDBFILELOCATION/+DATAC1/vbmtmdppg/g' /u01/app/oracle/admin/vbmtmdpp/cr_db/mtmp_plug_pdb.sql

I get the error below sed: -e expression #1, char 27: unknown option to `s'

fedorqui
  • 275,237
  • 103
  • 548
  • 598

1 Answers1

1

You must escape the / in the replacement string:

sed -i 's/CDBFILELOCATION/+DATAC1\/vbmtmdppg/g' /u01/app/oracle/admin/vbmtmdpp/cr_db/mtmp_plug_pdb.sql

Alternatively, you can use a different delimiter in place of /:

sed -i 's|CDBFILELOCATION|+DATAC1/vbmtmdppg|g' /u01/app/oracle/admin/vbmtmdpp/cr_db/mtmp_plug_pdb.sql
redneb
  • 21,794
  • 6
  • 42
  • 54