zsh-users
 help / color / mirror / code / Atom feed
* Filtering argument lists (e.g. for grep)
@ 2015-12-07 10:56 Dominik Vogt
  2015-12-07 11:18 ` Dominik Vogt
  2015-12-07 11:23 ` Peter Stephenson
  0 siblings, 2 replies; 8+ messages in thread
From: Dominik Vogt @ 2015-12-07 10:56 UTC (permalink / raw)
  To: Zsh Users

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-12-07 13:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-07 10:56 Filtering argument lists (e.g. for grep) Dominik Vogt
2015-12-07 11:18 ` Dominik Vogt
2015-12-07 11:23 ` Peter Stephenson
2015-12-07 11:39   ` Dominik Vogt
2015-12-07 11:56     ` Nikolay Aleksandrovich Pavlov (ZyX)
2015-12-07 12:03     ` Nikolay Aleksandrovich Pavlov (ZyX)
2015-12-07 12:06       ` Nikolay Aleksandrovich Pavlov (ZyX)
2015-12-07 12:58         ` Nikolay Aleksandrovich Pavlov (ZyX)

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).