Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: =() and &! don't go together?
- X-seq: zsh-workers 29742
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: =() and &! don't go together?
- Date: Mon, 29 Aug 2011 08:59:32 -0700
- In-reply-to: <20110828171925.0b1510ea@pws-pc.ntlworld.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <878vqhivmm.fsf@gmail.com> <20110828171925.0b1510ea@pws-pc.ntlworld.com>
[>workers]
On Aug 28, 5:19pm, Peter Stephenson wrote:
}
} On Thu, 25 Aug 2011 13:22:09 +0200
} Stepan Nemec <stepnem@xxxxxxxxx> wrote:
} > It looks like when &! is used (i.e., "program =(computation) &!"), the
} > temporary file created by =() does not exist at the point the command
} > tries to access it. Is there a solution to this?
}
} I think the basic problem here is that =(...) uses a temporary file, and
} if you've told the shell to forget about the process it's just created
} there's nothing to tidy up the temporary file. I would have guessed it
} would simply not tidy up the file at all, however instead it seems it
} tidies it up even before it's used, which doesn't seem particularly
} useful.
It's not precisely the case that the file is tidied up before it's used.
cat <=(echo foo) >bar &!
will copy "foo" into bar even though the tempfile is removed. Depending
on the program used in place of "cat", <=(...) may be superior to <<(...)
because the former is seekable whereas the latter usually isn't.
There are similar "temp file is removed too soon" problems with other
shell constructs. I'm not sure that abandoning the file in this one
special case is the right thing.
} You can work around both problems with
}
} (program =(computation)) &!
Or { ... }&! too.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author