Possible duplicate:
bash: double or single bracket, parentheses, braces
Looking at the rc.dcron script in archlinux:
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
name=crond
. /etc/conf.d/crond
PID=$(pidof -o %PPID /usr/sbin/crond)
case "$1" in
start)
stat_busy "Starting $name daemon"
[[ -z "$PID" ]] && /usr/sbin/crond $CRONDARGS &>/dev/null \
&& { add_daemon $name; stat_done; } \
|| { stat_fail; exit 1; }
;;
So far I can understand most of the syntax that this does:
[[ -z "$PID" ]]
I saw it also like:
[ -z "$PID" ]
In the link, I found what is []used in the if-statement, but here I do not see this. Any help is much appreciated. Thank!
source
share