I need to add text from 1 file to multiple files between 2 tags. all files have same extension .sh but different names and all all in subdirectorys.
i tried modify this but its only working for search and replace:
file=$(cat file1.txt)
replace="s/end=date +%s/$file/g";
find . -type f -name '*.sh' -print0 | xargs -0 sed -i "$replace"
file1.txt
some text here
some text here
some text here
some text here
some text here
final output and content of file1.txt added as new line below end=date +%s to all .sh files
end=date +%s
some text here
some text here
some text here
some text here
some text here