From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10318 invoked from network); 30 Sep 1997 02:49:05 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 30 Sep 1997 02:49:05 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id WAA01222; Mon, 29 Sep 1997 22:32:47 -0400 (EDT) Resent-Date: Mon, 29 Sep 1997 22:30:55 -0400 (EDT) From: TGAPE! Message-Id: <199709292128.VAA10542@dal-tsa12-29.cyberramp.net> Subject: Re: is text file? To: gjb@cs.washington.edu (Greg Badros) Date: Mon, 29 Sep 1997 21:28:33 +0000 (GMT) Cc: schaefer@brasslantern.com, unpingco@mpl.ucsd.edu, zsh-users@math.gatech.edu In-Reply-To: from "Greg Badros" at Sep 29, 97 09:25:19 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"eVzYY.0.HI.VH6Cq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1046 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Greg Badros wrote: > > "Bart Schaefer" writes: > > Perhaps it would seem less hacky if there were a general > user-programmable glob feature that would call a function on each > filename and accept that file for the glob iff the function returns > 0. Then the way that you determine what kind of file a filename points > to is not part of the shell, but the nice glob modifier interface is > permitted. It thusly degenerates to the case of running a find operation which execs file on all of your files, and greps out binaries & data. Nothing really gained, execept baggage. >> An approximation might be (with extendedglob set): >> >> % ls **/*~*(${~${(j/|/)fignore}})(.) >> >> That is, all plain files that do not have extensions listed in `fignore'. >> You could change (.) to (.^*) to omit executables, but that would also >> omit most shell scripts. >> >> (Somebody tell me why the extra ${~...} is needed in that expression.) > > I'm fairly certain I'll never type such an incantation (how long did it > take to dream it up? :-) ). Leave wizard's school now. You don't have the potential. That incantation is trivial compared to somethings I've done. Remember, everything can be done as a perl one-liner. This can be translated into a zsh command line. There's an emacs minor editting mode which already does it, however. Ed (well, everything except testing links, rather than what they point to. Or am I missing something? Please tell me I am; I've a tchell script I don't want to admit to owning. Overly-complicated programs should never be written in csh-family shells.)