Didier Trosset Didier Trosset - 4 months ago 11
Linux Question

How to pipe program output in an editor?

I have my program generating some data. It output everything on standard error.

Now I'd like to redirect the output to a newly started text editor, into the main unnamed edit window that shows at startup. I tried with vim and gedit without success.

myprogram | gedit
myprogram | gvim


Anyone knows about an X11 text editor that would support this?

Answer

If you want to redirect stderr of your program in to gvim you can do:

myprogram 2>&1 | gvim -

and in case if you want to redirect the stdout to the editor you can do:

myprogram| gvim -
Comments