bash insert a line at top of file code example
Example 1: bash add text to the beginning or end of every line
# Basic syntax:
awk '{print "PREFIX"$0}' input_file
# Prepend "PREFIX" to every row in the input_file
awk '{print $0"SUFFIX"}' input_file
# Append "SUFFIX" to every row in the input_file
awk '{print "PREFIX"$0"SUFFIX"}'
# Prepend "PREFIX" and append "SUFFIX" to every row in the input_file
Example 2: bash add comma to end of line
sed "s/$/,/g"