From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24927 invoked by alias); 7 Dec 2015 11:06:36 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21057 Received: (qmail 12284 invoked from network); 7 Dec 2015 11:06:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: vogt@linux.vnet.ibm.com X-IBM-RcptTo: zsh-users@zsh.org Date: Mon, 7 Dec 2015 11:56:22 +0100 From: Dominik Vogt To: Zsh Users Subject: Filtering argument lists (e.g. for grep) Message-ID: <20151207105622.GA18231@linux.vnet.ibm.com> Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: Zsh Users MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15120710-0025-0000-0000-00000529CF4B 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 $ * 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