> > Gibt es einen Unterschied zwischen :
> > 
> > --------------------------------------
> > #!/bin/bash
> > 
> > if (rpm -q rsyslog &> /dev/null) ; then
> [...]
> > und
> [...]
> > if rpm -q rsyslog &> /dev/null ; then
> 
> man bash:
> 
>    Compound Commands
>        A compound command is one of the following:
> 
>        (list) list is executed in a subshell environment (see COMMAND
>        EXECUTION ENVIRONMENT below).  Variable  assignments  and  builtin
>        commands
>               that  affect  the  shell’s environment do not remain in effect
>               after the command completes.  The return status is the exit
>               status of
>               list.
> 
> Die Befehlsliste in runden Klammern wird in einer Subshell ausgeführt.
> Die Bash startet als Kindprozess eine neue Shell, führt die Befehle darin aus
> und liefert nach Beendigung der Shell den Return Code zurück.

Aha. Also ist lediglich das Starten des Kommandos in einer Subshell der 
Unterschied.
Also ist der Aufruf ohne Klammern ressourcenschonender, da keine zweite Shell 
gestartet wird ?


Ralph
-- 
Linux mailing list [email protected]
subscribe/unsubscribe: http://lug-owl.de/mailman/listinfo/linux
Hinweise zur Nutzung: http://www.lug-owl.de/Mailingliste/hints.epo

Antwort per Email an