I have a $template
file that will invoke sed
to do some templating. after this is done I want to redirect the new $template
file to another directory named output
and the new file name will be newtemplate
.
portion of my shell script:
sed -r -i.bak -e "{
# templating done here.
}" $template > $data/$newtemplate
this successful creates a file $newtemplate
to the $output
directory but it doesn't invoke sed or does any templating.
So in short, how do I use sed
on the $template
file and then take the templated file and redirect it to output
directory under the new name newtemplate
-i
option if you want to create another file, with a different name? – Oct 25 '20 at 17:11