zsh-users
 help / color / mirror / code / Atom feed
From: "A. Wik" <aw@aw.gs>
Cc: Zsh users <zsh-users@sunsite.dk>
Subject: Re: Quoting =(command)
Date: Mon, 15 May 2006 15:17:21 +0000 (GMT)	[thread overview]
Message-ID: <20060326193417.C67912@dynamite.narpes.com> (raw)
In-Reply-To: <200603261837.k2QIbOow004386@pwslaptop.csr.com>


(Look, it's not even a month old ;)

On Sun, 26 Mar 2006, Peter Stephenson wrote:

> [This is probably more in the line of zsh-users.]

I'm inclined to agree - however, not considering the point
of view of posting at the time of reading the subscription 
instructions, I interpreted them as "just forget zsh-users
and join zsh-workers for the full range of content"... (but
I'll try it now.)

> "A. Wik" wrote:
> > 
> > How do I quote the =(<commands>) syntax that returns a the
> > name of a temporary file containing the output of <commands>?
> > 
> > Example: star is an improved tar program that can take a list of
> > files to archive through the =<list> command-line parameter - in
> > this case, the list is to be generated by the find program:
> >     # star -cv f=etc-bak.tar -C / list==(cd / ; find ./etc -newer /tmp/mtime.
> > ref)
> >     zsh: parse error near `)'
> 
> Do you mean star takes a *file containing* the list of files to archive?
> If it was just the list itself, then you would use "$(...)".

Yes, I did mean the former - the argument of "list=" is always
a file name... or as I discovered later, a dash (-) for reading
from stdin, and which was, of course, the perfect solution to my
problem.

Although the lone dash is interpreted similary by many other
programs too, a solution internal to the shell is certain
to come in handy some day... and Bart's second reply suggests
a workaround about as concise as can reasonably be expected:

	star -cv f=bak.tar list=${:-=(commands...)}

Perhaps it should be mentioned or at least hinted at in the 
context of the =() construct, as that was where I started
looking.   Considering that even you as the lead developer
managed to miss it, the odds may not be in favour of the
casual explorer doing so... but at least hindsight seems
to help:

       ${name:-word}
	      If name is set and is non-null then substitute
	      its value; otherwise substitute word. If	name
	      is missing, substitute word.

-aw


  parent reply	other threads:[~2006-05-15 15:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200603261837.k2QIbOow004386@pwslaptop.csr.com>
2006-03-26 20:55 ` Bart Schaefer
2006-03-26 20:58   ` Bart Schaefer
2006-05-15 15:17 ` A. Wik [this message]
2006-05-15 16:10   ` Bart Schaefer

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=20060326193417.C67912@dynamite.narpes.com \
    --to=aw@aw.gs \
    --cc=zsh-users@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).