Skip to content

Instantly share code, notes, and snippets.

@liamnewmarch
Last active May 18, 2021 09:50
Show Gist options
  • Save liamnewmarch/8e3c7bcd306ec10b18c1b62ac51d86ad to your computer and use it in GitHub Desktop.
Save liamnewmarch/8e3c7bcd306ec10b18c1b62ac51d86ad to your computer and use it in GitHub Desktop.
Copy and paste commands from the internet worry free*!
#!/bin/bash
printf 'Are you sure you want to run this command? [Y/n] '
read -r yn
case $yn in
[Yy]* | '' )
"$@"
;;
* )
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment