Tuesday, May 7, 2024
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 6414  / 2 Years ago, thu, april 14, 2022, 5:13:30

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


More From » command-line

 Answers
4

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
pieu333.sh
oli@bert:~/Desktop/rawr$ rename 's/u333/PIE/' *
oli@bert:~/Desktop/rawr$ ls
piePIE.sh


Your quotes seem to be throwing it off.


[#39253] Thursday, April 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
inciplyies

Total Points: 10
Total Questions: 114
Total Answers: 93

Location: French Polynesia
Member since Sun, Dec 20, 2020
3 Years ago
;