i want to replace the date value in a file. I am using this
date="20060501"
cat file | sed '3,$s/[0-9]*/$date/' > file_tmp
mv file_tmp file
But the output is absurd the date variable is not expanded. How do I expand this variable in sed. Solution in awk will also be preferred.
Thanks in advance