Hello,
Im working on this problem for 3 days now and i just cant get it to work.. I tried with alot of different sed methods but didnt find any solution. Its proberly verry simple but i just started bash scripting for a month or so..
i have a file called: file.nfo and file.txt
the content of file.nfo is
test23423
test 234
test3443
whole lot of text
the content of file.txt is
[nfo]nfotxt[/nfo]
I want to replace nfotxt with the content of the file.nfo
i do that with:
txtfile=file.txt
nfo=file.nfo
nfotext="$(cat "$nfo")"
then i use sed to search and replace like:
sed -e "s/nfotxt/$nfotext/g" $txtfile
i also did an escape \ or qoute "$nfotext"
The problem i have is that it doesnt replace the nfotxt with the content of the file.nfo and that it wil replace it with $nfotext rather then the content.. Hope someone can enlighten me or point me in the right direction..