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

Re: how can I skip globbing through SCCS subdirs?



>> P Stephenson writes:

 Peter> This means you can exclude SCCS directories like this:
 Peter> ls **/*.c~(*/)#SCCS/*

 Peter> The (*/)# is a trick so that top level SCCS directories are
 Peter> ignored as well as any /SCCS/ bits in the middle somewhere.

Marvellous!  that seems to work great.

This also seems to be equivalent:

ls **/*.[ch]~**SCCS/*

Interestingly, using `time' indicates that the form above spends less
time in the system, but more time in user space.  (I ran the experiment
multiple times and the results below are pretty representative of a
rough average)

/bin/ls **/*.[ch]~**SCCS/*: 0.89s(r) 0.37s(u) 0.19s(s) (63%)

/bin/ls **/*.[ch]~(/*)#SCCS/*: 0.99s(r) 0.15s(u) 0.28s(s) (43%)

Should there be any performance difference between using **SCCS and
(/*)#SCCS ?


Is the exclusion pattern (to the right of the ~) evaluated once per file
that matches the left hand side, or is it evaluated for everything, and
then somehow merged with the output of the left side?

Would it be more efficient to narrow the scope of the exclusion by using
this?:

ls **/*.[ch]~**SCCS/*.[ch]

[ Again, please copy me on any replies, since I'm not on the alias ]

Thanks,

    --- John.



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