On Dec 14, 2011 1:47 AM, "Toby
Thain"<toby at telegraphics.com.au> wrote:
On 13/12/11 12:13 AM, Sean Conner wrote:
> It was thus said that the Great Toby
Thain once stated:
>
>> On 12/12/11 3:53 PM, Sean
Conner wrote:
>>
>>> It was thus said that
the Great Toby Thain once stated:
>>>
>>>> The
representation that Unix uses is effective for these use cases.
Can
>> you give an actual example of where Unix
handles extensions "very
>> poorly"? (Your faux-DOS command doesn't seem to qualify, as it is
>> neither about Unix (rather, shell), nor a valid use of mv.)
> Well, it depends upon your definition of "Unix". There are
certain
> commands I've come across that handles extentions poorly. Like gunzip:
> And GCC also has trouble with
extentions:
Errr... again, these are *programs*, not
Unix...
Again, what is *your* definition of Unix? The Unix *kernel* only cares
Easy. You can make the program behave how you like regarding extensions,
but it
will still run on Unix.
It's not necessary to change the operating system to fix this. But
perhaps
Liam misspoke in the heat of the moment, and meant "*shell* handles
file extensions very poorly". I haven't seen a correction in this vein yet,
so this is only a theory.
Well, /strictly/, yes, but since I have
never seen or heard of a single
UNIX or Linux shell that does what I consider to be the sane or right
thing, I think it's fair to say that it's an attribute of the OS as a whole.
I said this was a shell problem, but it's not necessarily even that
(assuming we are STILL talking about that rename example).
It's really an issue at the level of the rename *program* (not 'mv'
which has different semantics - as the example underlines) and a good
solution was hinted at by you:
$ ren @.log @.old
Where @ is a globbing operator that has the desired 'zip' semantics (not
*'s semantics, as we have so laboriously hammered to death). Such a
'ren' could be a 1-line Perl script...
But in any ahem Unix system, you can already do, ad hoc:
$ ls | perl -n -e 'chomp; m/(.*)\.log$/ && rename($_,
"$1.old");'
Use 'find' to do it recursively, of course (try doing *that* in DOS).
Insisting it's a "Unix" problem is like saying mammals have prickly
feathers.
--T