Jonas Witt:
Am Fri, 16 Apr 2004 19:47:47 +0200 schrieb Erik Schanze schanzi_@gmx.de: Hi Erik,
Falk Döring:
[[ -f ~/.alias ]] && [[ -z $LOAD_SYSTEM_ALIASES ]] && return 0 [[ -n $IGNORE_SYSTEM_ALIASES ]] && return 0
Wieso doppelte "["?
Nach 'man bash':
"[[ expression ]] Return a status of 0 or 1 depending on the evaluation of the conditional expression expression. Expressions are composed of the primaries described below under CONDITIONAL EXPRESSIONS. Word splitting and pathname expansion are not performed on the words between the [[ and ]]; tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal are performed.
[...]"
Aha. Weil es da steht. Es geht aber auch folgendes:
es@morpheus:~$ [[ -f ~/.bashrc ]] && echo ja ja es@morpheus:~$ [ -f ~/.bashrc ] && echo ja ja
[[ expression ]] tut dasselbe wie 'test expression'.
Der Operator ist "[" (ein Mal) und der tut das Gleiche wie test expression
Wozu also doppelt?
Freundlich grüßend,
Erik