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

Filtering argument lists (e.g. for grep)



For some commands, there are some file patterns that I never want
to pass to the command (unless explicitly stated otherwise).  For
example, grep'ing should normally ignore backup and ChangeLog files

 *ChangeLog*
 *~
 \#*

Maybe grep is a bad example because this can be done with the
--exclude= option.  But could zsh help filtering the names
generated by globbing in a more general way so that I could write

  $ <foo> *

and have zsh automagically filter the results of the * (not
everywhere; only for commands that have this feature enabled) so
that the non-matching names are not passed to the command in the
first place?

The only way I can think of is to write some function for each
command to be preprocessed, parse the arguments to figure out
which ones are file names and then use some utility function to
filter them.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany



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