zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh <zsh-workers@sunsite.dk>
Subject: Re: Getting rid of temporaries...
Date: Fri, 12 Sep 2003 18:39:20 +0000	[thread overview]
Message-ID: <1030912183920.ZM14964@candle.brasslantern.com> (raw)
In-Reply-To: <22662.1063358877@gmcs3.local>

On Sep 12, 11:27am, Oliver Kiddle wrote:
}
} Wasn't as easy as I thought. Thought I could do something like:
} 
} guniq() { eval "[[ -z ${~REPLY:r:r}.<${~REPLY:r:e}->.jpg(N[2]) ]]" }
} print -l *.??.jpg(e:guniq:)
} 
} But eval insists on quoting the third word in what it runs so it does
}   [[ -z 'foo.<28->.jpg(N[2])' ]]
} which is no use.

It's not eval that quotes that, it's [[ ]].  The argument to -z et al.
is never expanded as a glob pattern.

If you use [ -z ... ] instead, you'll get better results.  Well, except
in 4.0.6, where you'll get a core dump, but that seems to be fixed in
4.0.7 and 4.1.1.

So without the function, it's

print -l *.??.jpg(e@'eval "[ -z ${~REPLY:r:r}.<${~REPLY:r:e}->.jpg(N[2]) ]"'@)

where @ is chosen as a character that appears nowhere in the expression.


  reply	other threads:[~2003-09-12 18:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-10 20:34 DervishD
2003-09-10 22:38 ` Danek Duvall
2003-09-11  1:06   ` Bart Schaefer
2003-09-11  1:46     ` Danek Duvall
2003-09-11  6:29     ` Oliver Kiddle
2003-09-11  8:56       ` Bart Schaefer
2003-09-11  9:40         ` DervishD
2003-09-11  9:43         ` DervishD
2003-09-11  9:39       ` DervishD
2003-09-12  9:27         ` Oliver Kiddle
2003-09-12 18:39           ` Bart Schaefer [this message]
2003-09-13 17:13             ` DervishD
2003-09-13 17:12           ` DervishD
2003-09-11  9:36     ` DervishD
2003-09-11  9:30   ` DervishD

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=1030912183920.ZM14964@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /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).