I have a variable in data/time format and I want to replace it with the first parameter of below string in a file with the user input variable
TO_DATE('07/13/2021 00:30:00' 'MM/DD/YYYY HH24:MI:SS')
I want to replace
'07/13/2021 00:30:00' with my variable.
I have a script which would take user input for start time and store it in a variable 'st'
I have a sql file which a static query. I need help in replacing TO_DATE('07/13/2021 00:30:00' with the variable and then the script would execute.
Tried below sed command and it's not working
sed -e 's/(.TO_DATE()[^ ]( .*)/\1'$st'\2/' /apps/tmp/abc.sql
Getting error message: Unknown option to `s' I am new to sed stuff. I am new to sed stuff
Can someone please help?