add confirm.sh
This commit is contained in:
12
confirm.sh
Executable file
12
confirm.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Put confirm before any command in a bash script - the command will be displayed and only run after pressing enter
|
||||||
|
# if that's not intended, the script can be aborted with CTRL+C
|
||||||
|
# this extremely basic implementation does not offer continuing the script any other way - it has to be aborted.
|
||||||
|
|
||||||
|
confirm() {
|
||||||
|
echo "Enter to run: $@"
|
||||||
|
read
|
||||||
|
$@
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user