I have a file that contains:
I want to replace in bash, the value 0
When the replacement string has newlines and spaces, you can use something else.
We will try to insert the output of ls -l
in the middle of some template file.
awk 'NR==FNR {a[NR]=$0;next}
{print}
/Insert index here/ {for (i=1; i <= length(a); i++) { print a[i] }}'
<(ls -l) template.file
or
sed '/^Insert after this$/r'<(ls -l) template.file