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

Re: Filename Generation - *(.)



On Fri, Oct 05, 2007 at 09:03:32PM +1300, Atom Smasher wrote:
> these do what i'd expect:
>  ls ./*(.)    # list all regular files in the current dir
>  ls *(.)      # list all regular files in the current dir
>  grep foo ./*(.)    # grep 'foo' from regular files in the current dir
>
> this doesn't:
>  grep foo *(.)
>
> can anyone explain that?
>
> zsh 4.3.4 (amd64-portbld-freebsd6.2)
[...]

In which way does it not work?

Would you have a file whose name starts with "-" in the current
directory and a GNU grep by any chance?

In any case, when passing /unknown/ arguments (practically, if
you can't make sure none of them may start with a - or +), you
need to mark the end of options:

grep foo -- *(.)

-- 
Stéphane



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