News for hackers. Stuff that matters.
Re:Why "ls *.c" is at least dumb, and possibly dangerous by wvenable on Friday October 09, 2009 @12:27AM (#870631)
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.

Re:Why "ls *.c" is at least dumb, and possibly dangerous by bobbyi on Friday October 09, 2009 @02:08AM (#870731)
It'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.
Re:Why "ls *.c" is at least dumb, and possibly dangerous by wvenable on Friday October 09, 2009 @12:36PM (#871758)
Shouldn'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.
Re:Why "ls *.c" is at least dumb, and possibly dangerous by snprbob86 on Friday October 09, 2009 @03:45AM (#870819)
As a Windows developer, I can tell you with certainty that practically no one does it even close to the same.