I am having problems using variables in a sed command.
For example, if I want to convert all ocurrances of AAA to BBB in file1 resulting if file2, I can use
sed 's/AAA/BBB/g' file1 > file2
If I try it with variables like this, it doesn't work
FROM="AAA"
TO="BBB"
sed 's/$FROM/$TO/g' file1 > file2
For example, if I want to convert all ocurrances of AAA to BBB in file1 resulting if file2, I can use
sed 's/AAA/BBB/g' file1 > file2
If I try it with variables like this, it doesn't work
FROM="AAA"
TO="BBB"
sed 's/$FROM/$TO/g' file1 > file2