6 ms·
Is there a simple command you can use to read the contents of the script (pipe) before it's sent to sh? Something like: curl ... | less-and-maybe-cancel |
by daxterspeed 7y ago
Is there a simple command you can use to read the contents of the script (pipe) before it's sent to sh? Something like:
curl ... | less-and-maybe-cancel | sh
- diogotito 7y agoYou can pipe the output of cURL to Vim like this: curl ... | vim - Then, you can review the script, maybe tweak it a little, and you can send it to sh's stdin by running :w !sh Or you can just quit Vim (:q! or ZQ) and nothing happens.
- OskarS 7y agoYeah, "vipe" from moreutils (which is a package on most platforms) does this. It inserts $EDITOR (usually vim) into the command pipe, and allows you to review and/or edit the text before passing it on to the next thing in the pipeline. Great little command line utility, for all sorts of things. If you want to cancel, just erase the file. Or `:cq` in vim probably works as well.
- SanchoPanda 7y agoThe Maybe command sounds similair. https://github.com/p-e-w/maybe https://github.com/p-e-w/maybe