I see a lot of installation instructions which ask you to download a file and run it straight away like this: wget https://some-site.com/some-file.sh | bash. However I would like to pipe the file through to less first so I can see the file before piping the file to bash. How can I do this in a one-liner?
Download a file and pipe to multiple commands
bash;pipe
Using vipe from moreutils.  Demo with seq 20 instead of wget.Run this:seq 20 | EDITOR=less vipe | wc -l...and less opens the pipe for viewing.  Press q to quit less, and the line count from wc -l appears:20Now do the same:seq 20 | EDITOR=less vipe | wc -l...but this time, hit Ctrl-C, then q to quit less.  Because of the Ctrl-C, wc never runs.Therefore this should work:wget -qO- https://some-site.com/some-file.sh | EDITOR=less vipe | bash And if the code doesn't please, hit Ctrl-C.If you want to keep the file around despite maybe not wanting to run it, try this:wget -qO- https://some-site.com/some-file.sh | tee /tmp/some-file.sh |EDITOR=less vipe | bash ...and it'll work much the same, except that /tmp/some-file.sh will have the pipe contents as well.