zsh-users
 help / color / mirror / code / Atom feed
From: TGAPE! <tgape@cyberramp.net>
To: gjb@cs.washington.edu (Greg Badros)
Cc: schaefer@brasslantern.com, unpingco@mpl.ucsd.edu,
	zsh-users@math.gatech.edu
Subject: Re: is text file?
Date: Mon, 29 Sep 1997 21:28:33 +0000 (GMT)	[thread overview]
Message-ID: <199709292128.VAA10542@dal-tsa12-29.cyberramp.net> (raw)
In-Reply-To: <qrrn2kw84uo.fsf@demille.cs.washington.edu> from "Greg Badros" at Sep 29, 97 09:25:19 am

Greg Badros wrote:
>
> "Bart Schaefer" <schaefer@brasslantern.com> 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.)


  parent reply	other threads:[~1997-09-30  2:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-28 22:31 Jose Unpingco
1997-09-29  0:06 ` Bart Schaefer
1997-09-29 16:25   ` Greg Badros
1997-09-29 17:44     ` Bart Schaefer
1997-09-29 21:28     ` TGAPE! [this message]
1997-09-30  3:53       ` Bart Schaefer
1997-09-30 16:19       ` Greg Badros
1997-09-30 18:56         ` Bart Schaefer
1997-09-30 20:02           ` Greg Badros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199709292128.VAA10542@dal-tsa12-29.cyberramp.net \
    --to=tgape@cyberramp.net \
    --cc=gjb@cs.washington.edu \
    --cc=schaefer@brasslantern.com \
    --cc=unpingco@mpl.ucsd.edu \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).