0

I know that some command-line programs can open visual editors like Sublime in a "wait mode" which opens the editor, lets you edit, and on-close it resumes the program with the file contents (like git commit). I'm wondering if there's any way to write a pipeline like this:

cat $file | sort | [open sublime in wait mode] | grep abc

Ie, I want to take the output of one command, open it in an editor, let me make edits, then it continues the pipeline with the file contents.

Thanks!

ak0000
  • 215
  • Dunno about GUI editors, but there's vipe for command-line ones: https://unix.stackexchange.com/a/282384/70524 If you can figure out the right way to inoke Sublime to make it wait, setting the EDITOR or VISUAL environment variable to that should work for vipe. – muru Mar 29 '20 at 10:16
  • 2
    Found it: https://stackoverflow.com/a/33132018/2072269: EDITOR='subl --wait' – muru Mar 29 '20 at 10:19
  • 1
    You don't need to cat into sort, or to cat in anything actually. sort, as any program, can take a file as argument. sort $file | vipe | grep abc will do the work. –  Mar 29 '20 at 10:22

0 Answers0