linux shell check if directory does not exists

C++
if [ ! -d directory ]; then
  mkdir directory
fi
Source

Also in C++: