Re: OT: Wildcard renaming of files
Michael Abraham Shulman wrote:
> "csj" == csj <csj@mindgate.net> writes:
>
> csj> I have a bunch of files I want to rename from .html to .htm. Is
> csj> there I way to rename them all at once?
>
> $ mmv '*.html' '#1.htm'
Thanks to everybody that replied. I settled for the program "mmv." It's
relatively simple (read, idiot-proof). It even works on my Mandrake (courtesy
of alien).
Martin Fluch wrote:
> A little bit bash programming...
>
> for $i in *.html ; do mv "$i" "${i:0:${#tmp}-1}" ; done
>
> Yes, I know, that this is quite cryptic ... but unfortunately I'm to tired
> to explain it ... I've need some sleep :-)
>
> Nevertheless it should work. Try 'man bash' for more information, but it
> is long...
I couldn't get any of the scripts (Martin, Colin Watson) to work. The error
message has me stumped.
"script.txt: `$i': not a valid identifier"
Reply to: