changed gpub from csh to bash added some vars for flexibility