3 ms·
This article does point out one thing that I've always found really strange/dumb about Unix. Why does the shell expand the wildcards? That's not how it works
by wvenable 17y ago
This article does point out one thing that I've always found really strange/dumb about Unix. Why does the shell expand the wildcards? That's not how it works in Windows, for example.
I periodically have to cleanup abandoned and overflowing unix mailboxes where every message is it's own file. You'd think a simple "rm *" would work, but it doesn't, because you get an error message saying that there are "too many arguments". From my perspective there's one argument, the asterisk. Very confusing. I end up having to use xargs to get it work. Seems like a poor design.
- bobbyi 17y agoIt's so that every script in the world doesn't have to duplicate the logic for how to interpret globs. They inevitably won't end up doing it exactly the same way.
- snprbob86 17y agoAs a Windows developer, I can tell you with certainty that practically no one does it even close to the same.
- wvenable 17y agoShouldn't that be part of the OS API? Why call me with 1,000 arguments, when I could call an API with the wildcard and get the 1,000 files back? My poor argv can't handle it the other way.