23-May-2013 01:51, H. S. Teoh пишет:
On Tue, May 21, 2013 at 08:56:13PM +0200, Jacob Carlborg wrote:
On 2013-05-21 20:34, Nick Sabalausky wrote:
Ugh, yea, that's right. I love the unix shell, but I'm convinced that
having the shell expand globs was a colossal mistake.
I think it's mostly very handy.
[...]
I'm a total unix shell geek (my X11 environment is basically a glorified
terminal, no window decorations, everything is maximized, no mouse
dependence, etc.), but I have to agree that having the shell expand
globs was a mistake.
The *reasoning* behind it was NOT a mistake: you want a standard syntax
for wildcards across the board, that users can rely on, instead of cp
taking one syntax, mv another syntax, and ls yet another syntax. (One
example of this latter is the sheer number of regex variations on a
typical unix installation, many of which are mutually incompatible, or
compatible but with subtle variations that nobody can remember. It's an
embarrassment!)
The *chosen solution*, though, was mistake. The correct solution was to
have a globbing function in a standard library that programs would use
to expand wildcards.
Windows had it in WinAPI - FindFirst/FindNext. Programmers basically had
it yet it didn't mean they used it even half-consistently (nor it was
complete glob pattern).
--
Dmitry Olshansky