Im having problems using SED to replace with a variable. I assume the problem is that the variable contains spaces.
Code:
data=$(grep 'DATA' vsm.scr)
echo $data
sed "s/loc/$data/g" v1.scr > v2.scr
I just did the echo to make sure my variable is correct which it is. It has the format below:
DATA /home/temp/abc.txt
(There are additional spaces in front of DATA, they dont show up in the forum post)
Ive tried setting the variable as a simple number and everyhting works fine, which leads me to believe its a problem with the spaces
Any ideas?