What does [] do in bash?

Viewed 12622

Possible Duplicate:
bash: double or single bracket, parentheses, curly braces

Looking at the rc.d cron 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; }
    ;;

While I can figure out most of the syntax, what the heck does this do:

 [[ -z "$PID" ]]

I saw that also written as:

 [ -z "$PID" ]

In reference I found that [] is used in if-statements, but I see none here. Any help is much appreciated. Thanks!

3 Answers
Related