Move sh to templates for portability