Hi,
My shell script searches a VALUE in a file, copies it to a variable and updates a line in another file with this new VALUE (replacing the old)
The value has a pattern-
VALUE=`
$$MyDate=11-11-2008 09.09.56.123456`
(yes the $ - . = and space are all part of the string)
I am having prob with sed
Which of the following should work?
a) sed 's/${oldDate}/${newDate}/' file1.txt > temp
b) sed 's/'"${oldDate}"'/'"${newDate}"'/' file1.txt > temp
c) sed "s/${oldDate}/${newDate}/" file1.txt > temp
d) sed "s#${oldDate}#${newDate}#"' file1.txt > temp
e) any other
searching all threads i had the above noted as possible solutions but all above options i've tried and none work
is using ${xyz} instead of $xyz the prob?
or i should try again? any 1 out of (a) - (d) must work?
is it something to do with what "shell" i m using?
sorry i'm 3 days old in unix
Thanks!