On 24 Nov 14:43, Chris Walker wrote:
I have a directory full of files and sub-directories which I've pulled from an emulator. But it has extra filename extensions on it. I would like to traverse this directory, stripping off the extensions and so I've been trying to write a script to do it but it's failing.
An example of a file is this :- lamborghini miura_1024.jpg,c85 and so there, I'd like to remove the ,c85. But a bigger problem is where I have the odd file which has a numeric extensions such as .;1 and that's where I struggle. How do I do a substitution in my script to cope with things like that?
I've been reading things like this - http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html and http://www.unix.com/answers-frequently-asked-questions/13774-unix-tutorials-... but I'm still struggling.
Can somebody point me in the right direction please, even if it's towards the door ;-)
You'll want to be typing "man rename", rename is in the main perl package, so it's very likely you've got it installed (assuming debian or ubuntu, as I usually do!).
Cheers,