Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash use cat in sed command

# Basic syntax:
sed 's/<search_text>/'"`cat replacement.txt`"'/' your_file
# Where:
#	- The replacement.txt file contains a single line that will be used
#		to replace the search_text, where found in your_file. 
# Note, this isn't very useful unless combined with other functions like
#		find exec, e.g.:
find *.txt -exec sed -i 's/search_text/'"`cat replacement.txt`"'/' {} ;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #cat #sed #command
ADD COMMENT
Topic
Name
4+2 =