sed - Assign a header to multiple files, Linux -
a header
file produced running main script , content changes anytime run program . want assign content of header file other 3 files header. content of other 3 files should not change except header. example file1
header content file1 content
for file2
header content file2 content
how done?
note: please consider program runs many times header must overwritten not many headers.
run code once preserve original files without header information:
for file in myfile1 myfile2 myfile3 cp ${file} ${file}.orig done
run code every time header file changes
for file in myfile1 myfile2 myfile3 cat header ${file}.orig > ${file} done
where myfile1, myfile2 , myfile3 3 original files referring , header file containing ever changing header information.
Comments
Post a Comment