From bacf8ab4ab70a6b5ff8049f60ef9d0e55f3f6d71 Mon Sep 17 00:00:00 2001 From: Christian Betz Date: Tue, 13 Jan 2026 14:06:56 +0100 Subject: [PATCH] add confirm.sh --- confirm.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 confirm.sh diff --git a/confirm.sh b/confirm.sh new file mode 100755 index 0000000..d36c401 --- /dev/null +++ b/confirm.sh @@ -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 + $@ +} +