Skripte/Utility/IsInteractive.sh

9 lines
144 B
Bash

#!/bin/bash
is_interactive() {
case $- in
*i*) return 1 ;; # Interaktive Shell
*) return 0 ;; # Nicht-interaktive Shell
esac
}