[Gllug] Processing filenames containing " with sed

Dylan dylan at dylan.me.uk
Thu Jun 3 16:19:17 UTC 2004


Hi All,

I've been playing with Mike's oneliner:

/bin/ls -C1 | sed "s/\(.*\) - \(.*\).mp3/mv \"&\" \"\2 - \1.mp3\"/"|sh

(see Swapping two parts of a filename)

I have one problem - it chokes on any filename containing a double 
quote. Since most of these mp3's are 12" versions, that's quite common! 
Can I deal with this case as well? Remembering that there are filenames 
with single quotes in them too!

Cheers

Dylan

-- 
"I see your Schwartz is as big as mine" 
                                  -Dark Helmet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list