-
-
Save kallmanation/a93d85b14b49575c3f416c7dd3d7bd46 to your computer and use it in GitHub Desktop.
/bin/$ - copying commands from strangers on the internet with (slightly less) reckless abandon!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Copying dangerous commands from the internet and forgetting to trim the `$` off the start? | |
# Getting all sorts of `# -bash: $: command not found` errors? | |
# This script is for you! | |
# `$ command` will now ask for confirmation before executing the gum you scraped off of stackoverflow! | |
echo "You are about to run the command:" | |
echo "$@" | |
read -n 1 -p "Do you want to continue? [yN]: " answer | |
echo "" | |
if [ "$answer" == "y" ]; then | |
echo "--- executing ---" | |
"$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment