Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

linux 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
Source by www.shellhacks.com #
 
PREVIOUS NEXT
Tagged: #linux #add #text #beginning #line
ADD COMMENT
Topic
Name
5+3 =