Correct a missing !.
Correct some problems with the CP variable.
Add the '-p' option to mkdir.