diff --git a/Utility/IsInteractive.sh b/Utility/IsInteractive.sh index 40390af..d7ba438 100644 --- a/Utility/IsInteractive.sh +++ b/Utility/IsInteractive.sh @@ -1,8 +1,10 @@ #!/bin/bash is_interactive() { - case $- in - *i*) return 1 ;; # Interaktive Shell - *) return 0 ;; # Nicht-interaktive Shell - esac + # Prüft, ob ein Terminal verfügbar ist + if [ -t 0 ] || [ -t 1 ] || [ -t 2 ]; then + return 0 + else + return 1 + fi }