Kpm pack generate bash scripts

parent #327 
I should add comments for this.