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