Is there a *nix tool that can be piped into that forces a confirmation prompt before executing all previous commands? I'm thinking of a tool that would allow you to put commmand line snippets on a web page but guarantee that cut-and-pasting of the command and accidentally pasting a CR/LF wouldn't cause damage to the target's computer.
Here's a simple example assuming there's a tool called 'confirm' and replacing the dev with 'safedev':
head -c 32 /dev/urandom | sudo openssl enc -rc4 -nosalt -pass stdin -in /dev/zero -out /dev/safedev | confirm
This question stems from my own experience of wrecking my mbr by cut and pasting a command from a browser and it unexpectedly grabbing the CR/LF and begin executing before I had a chance to change sda to sdc. I was forced to recreate the mbr and reinstall Ubuntu Gnome over my existing partitions in order to recover/recreate my main OS.
If this tool doesn't exist, is there another way of providing commands on a webpage that can force confirmation before executing the commands? Maybe something like this?
confirm && head -c 32 /dev/urandom | sudo openssl enc -rc4 -nosalt -pass stdin -in /dev/zero -out /dev/safedev