1

this one should be simple for anyone who knows the correct way to escape. I'm attempting to batch rename a few hundred files that had \u0026amp; pushed into the file names instead of and or &. I tried using:

rename s/"\\u0026amp;"/"and"/g * but and getting names like Excision \uand Datsik - Calypso.mp3 you can see the \u wasn't escaped properly. What's the way to escape my \??

Thanks

poolie
  • 9,358
ehime
  • 546

2 Answers2

7

Not sure why you're using quotes like that. Here's how I use rename:

rename 's/search/replace/' *

And here's it in action:

oli@bert:~/Desktop/rawr$ ls
pie\u333.sh
oli@bert:~/Desktop/rawr$ rename 's/\\u333/PIE/' *
oli@bert:~/Desktop/rawr$ ls
piePIE.sh

Your quotes seem to be throwing it off.

Oli
  • 299,380
0

I needed more trailing slashes evidently... =(

rename s/"\\\u0026amp;"/"and"/g *

ehime
  • 546