mkdir -p /path/to/something
when does the above command exit with nonzero exit status?
Does it happen, if and only if
/path/to/something doesn't exist as any file (or as a directory?) before running the command and the command fails to create it as a directory?
man mkdir says
-p, --parents no error if existing, make parent directories as needed