Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: preventing the leading space in process substitution
- X-seq: zsh-users 13209
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh users mailing list <zsh-users@xxxxxxxxxx>
- Subject: Re: preventing the leading space in process substitution
- Date: Wed, 10 Sep 2008 12:24:47 +0100
- In-reply-to: <20080909144101.GA30693@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20080909144101.GA30693@xxxxxxxxxxxxxxxxxxxx>
martin f krafft wrote:
> I am trying to use <(...) to pass a file to a command that expects
> the file argument following an equal sign, like so:
>
> mycommand -file=/path/to/some/file
>
> The problem is that
>
> mycommand -file=<(...)
>
> seems to yield
>
> mycommand -file= /proc/self/fd/16
>
> with the space before the filename. How do I prevent that?
For reasons buried in history that I don't understand, the <(...) is
parsed as a single complete argument. It's somewhat laconically
documented that they are "command arguments" and not parts of an
argument. This may just have been laziness.
You can use a front end function:
mycommand_file() {
mycommand -file=$1 "${(@)argv[2,-1]}"
}
mycommand_file <(...)
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author