Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: preventing the leading space in process substitution



On Wed, Sep 10, 2008 at 11:45:11AM +0200, Angel Olivera wrote:
> On Tue 09.Sep.08 15:41, 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?
>
> Also, how would one use =() in this case?
>
> One alternative is:
>
>   mycommand -file=$(print =(...))
>
> but there must be a nicer way.
[...]

a==(...) eval 'mycommand "-file=$a"'

Seems to work with a=<(...) as well.

You could also do:

mycommand -file=/dev/fd/3 3<> =(...)

If your system supports /dev/fd/<n>

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author