in a script job.sh I have this string:
/home/myname/code_DEM/ > output.txt
that I would like to substitute by:
/home/myname/code_DEM/ > output_"$datetime".txt
where $datetime is a string that automatically loads the date and time.
I tried to do so using the sed command
sed -i 's/"$LINEout"/"$LINEnew"/' job.sh
where $LINEout is the old string that I want to replace by $LINEnew which is the new string (the one with the date and time).
Up to now, I cannot get what I want, I have no change.
PS: if someone has the solution for both Linux and MacOs it would be great: I believe the syntax is slightly different from Linux to Mac for the sed command :)