```(test -d <path> && echo 0) || (mkdir -p <path>; echo 1)```

stdout == 0: dir existed, stdout == 1: dir was created, exit value != 0: creation failed:

```
/tmp $ (test -d /tmp/test && echo 0) || (mkdir -p /tmp/test; echo 1)
1
/tmp $ echo $?
0

/tmp $ (test -d /tmp/test && echo 0) || (mkdir -p /tmp/test; echo 1)
0
/tmp $ echo $?
0

/tmp $ (test -d /etc/test && echo 0) || (mkdir -p /etc/test; echo 1)
mkdir: cannot create directory `/etc/test': Permission denied
1
/tmp $ echo $?
130

/tmp $ (test -d /etc/init.d && echo 0) || (mkdir -p /etc/init.d; echo 1)
0
/tmp $ echo $?
0
```

:-)