improvements from cleanup.bat ported to bash

Now the cleanup.sh also uses no more absolute directories.