In my Unix AIX I need to replace the date in a parameter file with system date using a shell script that will run post session from PowerCenter.
I can use SED to replace a string variable but running into issue using date.
I have tried using commas instead of slashes as delimiters. The contents of the test file looks like this:
$$TESTFIELD=12/29/2016 14:57:51
The sed command I felt should work was:
sed -e "s,^\($$TESTFIELD=\).*,\1'date +"%D %T"'," testfile.txt > tmp.$$
After which I would move the tmp.$$
to testfile.txt
but the results threw the following error:
sed: 0602-404 Function s,^\(14680298TESTFIELD=\).*,\1'date +%D cannot be parsed.