Whenever I have to execute a shell script from the web curl -s [url] | sh, I first open url in my web browser to make sure the script isn't malicious and is safe to run. I remember seeing a command line trick that made it was possible to read the script from the command line and then confirm execution after reading the script. If I recall correctly, it looked something like curl -s [url] | something...here | sh and didn't require any software install.Does anyone know this trick?
Read and confirm shell script before piping from curl to sh (curl -s [url] | sh)
bash;command line;security;curl
There is a utility in moreutils called vipe that shows stdin in an editor, where you can revew and modify the file before it gets passed on to stdout.If you don't want to install moreutils, you can accomplish something similar like so:file=$(mktemp); curl -s $url > $file; $EDITOR $file; sh $file; rm $filemktemp is in coreutils and is very likely already installed on your system.