I am trying to create a shell script which can replace a text in another file.
open> gedit replace_curr_dt.sh
#!/bin/bash
curr_dt=$(date)
echo $curr_dt
sed 's/%CURR_DATE%/$curr_dt/g' curr_dt.txt
but it does not change the other file content.
I am trying to create a shell script which can replace a text in another file.
open> gedit replace_curr_dt.sh
#!/bin/bash
curr_dt=$(date)
echo $curr_dt
sed 's/%CURR_DATE%/$curr_dt/g' curr_dt.txt
but it does not change the other file content.
Use the -i
flag to replace inline.