jam <[EMAIL PROTECTED]> writes:

> Over the years I have seen many offerings on this topic, which I've
> mostly ignored until I need to do it and discover ITS HARD.

Not once you understand the relatively simple underlying principals,
I find; reading the bash info documentation on quoting is quite useful.

> Any kind input please:
>
> Oggs are now divided into oga and ogv. Kewl except some tools won't
> read .oga eg amarok and fiddling the mime types helps not.
>
> Brilliant, I'll just call all ogas oggs. So I've a directory dotted
> with Music/Jimi Hendrix/The wind calls Mary.oga (whatever) and I want
> to mv them to .ogg. Hours later, I can make a doit file and quote the
> args eg
>
> ==== doit ====
> mv "Music/Jimi Hendrix/The wind calls Mary.oga" "Music/Jimi Hendrix/The wind 
> calls Mary.ogg"
> ...
> ...
>
> but I'd really like to be a bit cleverer.

  # assume that none of your files contain a newline...
  find Music -type f -name '*.oga' | while read file; do \
      mv "$file" "${file/.oga/.ogg}"; done

Regards,
        Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to