Skip to content

Instantly share code, notes, and snippets.

@Ryan1729
Created December 19, 2019 15:49
Show Gist options
  • Save Ryan1729/09c10aca8246ae34fcd43f8aa00e7233 to your computer and use it in GitHub Desktop.
Save Ryan1729/09c10aca8246ae34fcd43f8aa00e7233 to your computer and use it in GitHub Desktop.
prompt-to-run script that allows editing command before executing.
# example usage:
# $ prompt-to-run 'echo hi'
prompt_acc=''
read -p 'run `'"$1"'`
' -i "$1" -e prompt_acc
eval "$prompt_acc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment