$ mkdir -p /tmp/foo ; echo $? 0 $ mkdir -p /tmp/foo ; echo $? 2 mkdir-sh calls 'mkdir' except when the target directory already exists.