Update generate.sh

1. rmr: DEPRECATED: Please use 'rm -r' instead.
2. if parent directorys are not exist, "-mkdir" will fail.