Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: spaces in filenames should be a crime.

On Wed, 29 Mar 2017 07:50:34 -0700
Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> On 29/03/17 04:27 AM, Stephane Chazelas wrote:
> > print -r -- **/*(D.om[1])
> Thanks.  Sorta like buying a boat that, out of the factory, has 15 holes 
> by design.  Slowly you find out where they all are and plug them and 
> then she's seaworthy. Dunno, ships have sea cocks, but they're closed by 
> default; the culture with shells is that they are all open by default.  
> I wonder what software would look like if things were robust by default 
> and then you subtracted functionality that you didn't want, so " **/* " 
> would mean every damn thing even on Tuesday and then you'd add options 
> to filter stuff out rather than adding it in.

(Obviously this is a pointless discussion, but while I'm waiting for
things to compile...)

The only thing missing by default is files beginning "." (that's the
D).  The "." and the "om[1]" are indeed subtracting things.

By demanding that globbing matches files beginning with "." by default,
you've just removed one of the earliest safety features built into
shells, so that people are condemned to have their initialisation files
show up with every glob.  It happens that most people don't consider
this "robust" for their purposes.  But if you're happy to sacrifice
usability. you can set the option GLOB_DOTS, and it works the way
you want.


Messages sorted by: Reverse Date, Date, Thread, Author