On 12/15/2011 7:21 PM, Toby Thain wrote:
On 15/12/11 9:34 PM, Josh Dersch wrote:
On 12/15/2011 5:21 PM, Toby Thain wrote:
Wow, that's so elegant. It only requires spawning two processes, piping
to a general purpose programming language, and using regexps to make it
work!
What is a glob but a regexp? And what is shell but a general purpose
programming language? And why have processes if you're not going to
use them?
Well, why limit yourself to just two processes, then? :)
For elegance, maybe you should write it all in C... Not to mention
that the 'elegant' solution (a 'ren' tool) was already given.
The "ren" tool suggested earlier in a different thread requires using a
different wildcard syntax (using '@' instead of '*') due to a
fundamental design choice in Unix wherein the shell must expand
wildcards on behalf of the programs it execs. I think consistency is
pretty important so I still don't see this as being elegant.
("Remember, use "*" for globbing, except for this one utility over
here...")
Wait, is elegant the word I want to use here? Hmm.
Since the thread started with the premise "DOS can do this but Unix
can't!!", elegance was going to be an unlikely theme.
Yeah, once you start involving Unix, elegance goes right out the window :).
And I'm pretty sure 'ad hoc' doesn't mean 'oh my god look at the
crystalline perfection of this'.
Yes, you're right. It's been a long day and my desire to say something
snarky overcame my ability to hold it in. Apologies :).
- Josh