Add sh directive and replace bash function with sh function.