Im using this sed command in order to replace a line in the hosts file but as I run the script it looks like its not replacing the variables per their value...
sed -i 's/${host_db}/${new_db} db-01/' /etc/hosts
Running using sh -x I get this:
+ new_db=10.216.193.68
+ host_db='12.18.1.61 db-01'
+ sed -i 's/${host_db}/${new_db} db-01/' /etc/hosts
Anything I might be missing?
Tks,
Joao
Shell Scripting
Last Comment
joaotelles
8/22/2022 - Mon
woolmilkporc
sed -i 's/'${host_db}'/'${new_db}' db-01/' /etc/hosts