bash cut from beginning to end of string 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 how to delete ^M at the end of every line
# Basic syntax:
dos2unix input_file