On Sat, 15 Dec 2012 13:26:55 +0000, d-...@hadrian-way.co.uk said: > Anyone got a good bash incantation for removing apostrophes in lots of > file- names?
My first thought on reading the above was "not in bash" (so I didn't answer). Yes, it *can* be done in bash, as others have ably demonstrated, but why put such a restriction on the solution? To be honest, using bash to deal with filenames that includes spaces, apostrophes and similar quickly becomes laborious. I had a very similar problem over the weekend: I want to rebuild my music collection (mostly .flac files), in a artist/album/track hierarchy, and I wanted to use the flac metadata comments to derive those details. That meant that my script would automatically build the correct directory tree and populate it. However, many files were tagged with names that included apostrophes, which I didn't want. It was trivial to remove them as part of a script - I used Python, but Perl could probably manage it too. But bash? I wouldn't waste my time trying. So, after all that, my question is: why did you restrict the answers you wanted to bash (I'm not criticising that restriction, but I am curious)? -- We're looking for smart Linux people: http://www.tiger-computing.co.uk/jobs -- Next meeting: Bournemouth, Tuesday, 2013-01-08 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue