bash 3 regex compatibility fix
Use newlines for dirs