scripts/confirm.sh

10 lines
172 B
Bash
Raw Permalink Normal View History

2024-09-22 12:36:46 +02:00
#!/bin/bash
echo "To be executed: $@"
read -p "Confirm (Y/N): " -n 1 -r
case "$REPLY" in
y|Y ) echo "es"; eval $@;;
n|N ) echo "o";;
* ) echo -e "\ninvalid";;
esac