generate the sh
first functional pass