write to file & shell run header