June 28, 2004

Sed part 3

Following on from Absoblogginlutely: renaming files on unix using sed the problem changed so that we had to rename files from A?\abc to A-abc. Various permutations of /, \, ", and ' were used until we came up with

#for file in * ; do mv $file `echo $file | sed 's/\?\\\\/-/'` ; done

Why we had to use 4 \ I'm not sure, but it worked.

Posted by Andy at June 28, 2004 10:59 AM