views:

32

answers:

2

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?

+1  A: 

I don't know of any editor that supports this, but redirecting to a temp file might be easier.

F=$(mktemp)
myprogram >$F
gedit $F
rm $F
Douglas Leeder
+3  A: 

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 -
codaddict
Yes, '-' stands in many programs for STDIN/STDOUT instead of a file.
eumiro
It's not even `stderr` that I want. Simply `stdout`. How is it possible I didn't though out to using file `-`! Answer is simply `myprogram | gvim -` .
Didier Trosset