On Dec 17, 2011 2:15 AM, "John Foust" <jfoust at threedee.com> wrote:
At 07:50 PM 12/16/2011, Toby Thain wrote:
>(I am aware of 'file', but that doesn't, to me, do what you're
suggesting.)
Most of the magic and usefulness of 'file' is due to the fact that many
commonly used files were in standard formats and did contain fixed magic
identifying bytes in their headers. It's metadata inside the file.
Extensions put the metadata in the filename, and look at all the tools
that assume filename extensions are standard (.sh, .c, .h, .m, .o).
Exactly my point. Well, one of them. UNIX /does/ have and use and even
depends upon file extensions, and yet, the shell does not really understand
them as a separate entity from the file's /name/... & it is poorer than the
admittedly far less powerful or capable Microsoft shell at manipulating
files /by extension/ a opposed to /by name/.
When I do "ren *.log *.log.old" I am manipulating a /collection/ of files
by their shared /extension/ and *not* by their name. No UNIX shell I am
aware of can do this. Sure, you can kludge around it with loops or scripts
or little Perl programs but that is more effort, more work and I would
argue less elegant.