Answers for "bash add text to the beginning or end of every line"

2

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
Posted by: Guest on October-01-2020

Code answers related to "bash add text to the beginning or end of every line"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language