Login  Register

check if string exists in file

Posted by Roshan on Mar 04, 2018; 3:59pm
URL: http://erman-arslan-s-oracle-forum.124.s1.nabble.com/check-if-string-exists-in-file-tp5298.html

Hi Erman,

Red Hat Linux 6

I have a shell script which executes an import dump. At the end of the import, I want to set the current date to a variable(IMPORTGAIAGCICIFLAG) in a file called application.properties.

now=$(date)

sed 's/^IMPORTGAIAGCICIFLAG.*/IMPORTGAIAGCICIFLAG='"$now"'/g'  /home/oracle/application.properties

The issue is that the variable IMPORTGAIAGCICIFLAG in application.properties does not get updated.

Can you please guide me.

Thanks,

Roshan