confirm
This commit is contained in:
parent
83c46ea4ee
commit
45fd2e35d5
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
echo "Write 'yes do as i say' to confirm that you REALLY want to do this: $@"
|
||||||
|
read
|
||||||
|
if [[ "${REPLY,,}" = "yes do as i say" ]]
|
||||||
|
then
|
||||||
|
eval $@
|
||||||
|
else
|
||||||
|
echo "aborting"
|
||||||
|
fi
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/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
|
||||||
|
|
Loading…
Reference in New Issue