Skip to content

Instantly share code, notes, and snippets.

@nepsilon
Created April 25, 2017 14:16
Show Gist options
  • Save nepsilon/71ba4dfef47f493b3c802e05da808380 to your computer and use it in GitHub Desktop.
Save nepsilon/71ba4dfef47f493b3c802e05da808380 to your computer and use it in GitHub Desktop.
How to edit data inside a pipe? — First published in fullweb.io issue #97

How to edit data inside a pipe?

Recommended by Fabien Loudet, Senior SysOps at Rosetta Stone

The vipe program from the moreutils package allows to "insert a text editor into a pipe". That is, run your EDITOR in the middle of a unix pipeline and edit the data that is piped.

command1 | vipe | command2

This is useful when installing softwares using the curl ... | sh method, to make sure the installation script won't do anything harmful to your system.

If you're using Vim, and want to abort piping to the second command, exit with :cq (quit Vim with a non-zero exit code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment