create directory if not exists bash code example
Example 1: bash cd or make dir if not exists
mkdir -p foo
Example 2: cp file and create directory if not exists
mkdir -p "$d" && cp file "$d"
mkdir -p foo
mkdir -p "$d" && cp file "$d"