[Eug-lug] Subject: Copying, moving, whatever... using wildcards in destination : wc2fn.py

jgw at absent.org jgw at absent.org
Sun Oct 31 13:38:05 PST 2004


This is all already possible with shell scripting. Shell scripting is very
friendly once you learn it. I recommend "UNIX Shell Programming" by SAMS
if you're further interested in shell programming. Or, you can do it your
way.

Further in your lengthy post, you mentioned that there aren't really any
friendly tools, just a bunch of programs with a specific function that'll
let you do what you want. This is how UNIX works, it's design philosophy.
I always recommend to folks that, while using UNIX, they learn the UNIX
way, as it's the least painful route in the long run.




>
> Let's say I want to make my digital images all lowercase:
>      	mv *.JPJ *.jpg
>
> As we know, this doesn't have the desired effect: the shell nicely matches
> any existing item ending in .JPG or .jpg . If the last matched name
> happens to be a directory every 'thing' else will be moved into it, but
> still being called .JPG . That's just one possible scenario, most likely
> the command will fail.
>
> So what the shell needs is a *friendly* utility that:
>    a) takes a given source pattern
>    b) builds a set of matched filenames
>    c) takes a replacement pattern for the destination files.
>    d) Based on (a-c) this tool will then generate one unique destination




More information about the EUGLUG mailing list