Auf verfügbaren Befehl prüfen

Auf verfügbaren Befehl prüfen

Wenn ich das Bash-Skript als Root-Benutzer ausführe, erhalte ich die Ausgabe, dass iptables nicht existiert. Warum passiert das nur mit Root?

for CMDAPP in "hash" "curl" "iptables"
  do

    if ! hash "$CMDAPP" 2>/dev/null
    then

        echo "`date`: $MODULE ended without '$CMDAPP' command." >> ERROR.log
        exit

    fi

  done

verwandte Informationen