The older bash version of macOS does not understand this escape and actually creates directories with "\" in their name. After this change it actually works with both versions.