Schöbi
Schöbi

Reputation: 25

/ in a script variable

I'd like to replace Music by Music/Oliver

The command:

find ./ -type f -exec sed -i 's/Music/MusicOliver/gI' {} \;

How do I insert the / without interrupting the command? I've tried with "string" and 'string' but it didn't work.

Thanks for your hints!

Upvotes: 1

Views: 30

Answers (1)

Diego Torres Milano
Diego Torres Milano

Reputation: 69208

You can use a different delimiter for sed command like

find ./ -type f -exec sed -i 's|Music|Music/Oliver|gI' {} \;

Upvotes: 1

Related Questions