On 23/07/09 18:28, Tim Chase wrote:
>
>> is it possible to vimdiff two "streams" coming from
>> two stdin sources somehow?
>>
>> Thank you very much for any help in advance!
>
> Well, Vim only gets one "stdin".
>
> However, in bash, you can used anonymous pipes:
>
>     vimdiff<(somecmd1 filea | filterX)<(somecmd2 fileb | filterY)
>
> to take the output of a series of commands and treat it as a
> pseudo-file.  In vim, you'd see this as editing /dev/fd/63 with a
> note that it's a fifo/socket but you can write the results
> wherever you want.
>
> If you don't run in bash, you'd have to save the intermediate
> results into temp files and clean them up when you're done:
>
>     somecmd1 filea | filterX>  temp1.txt
>     somecmd2 fileb | filterY>  temp2.txt
>     vimdiff temp1.txt temp2.txt
>     rm temp1.txt temp2.txt
>
> -tim

You could still, I think, direct one output to Vim's stdin:

        somecmd1 filea | filterX > temp1.txt
        somecmd2 fileb | filterY | vimdiff temp1.txt -
        # notice the dash at the end of the above line
        rm -vf temp1.txt

A program can have any number of inputs, but only one of them (handle 
zero on both Unix and Dos/Windows) can ever be _standard_ input.


Best regards,
Tony.
-- 
November, n.:
        The eleventh twelfth of a weariness.
                -- Ambrose Bierce, "The Devil's Dictionary"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to