header=$(head -n 1 fileinput) (printf "%s\n" "$header"; grep -vFxe "$header" fileinput ) > newfileoutput - grab the header line from the input file into a variable
- print the header
- process the file with
grepto omit lines that look likematch the header header - capture the output from the above two steps into the output file