How to pipe program output in an editor?

Viewed 13546

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?

6 Answers

vipe does this for an arbitrary $EDITOR, available on macOS /homebrew via brew install moreutils

command1 | vipe | command2

vipe allows you to run your editor in the middle of a unix pipeline and edit the data that is being piped between programs. Your editor will have the full data being piped from command1 loaded into it, and when you close it, that data will be piped into command2.

EDITOR: Editor to use.

Related