sed & script help
I am trying to write a script to access sqlplus and use the output to replace the result in another file. But I am having some issues with it (This script is just a test script and I am just trying to print the updated value.
I am not able to post the sqlplus connection, but it works.
echo a is $a
echo bb is $bb
echo "goodbye friend" | sed "s/goodbye/$var/"
echo "goodbye friend" | sed "s/goodbye/$bb/"
The output I get is
a is 30-APR-10
bb is 30-APR-10
sed: -e expression #1, char 10: unterminated `s' command
I am not sure why the last statement alone is not executing. Am I missing something?
So I don't see any problems.
[root@server ~]$ bb="30-APR-10"
[root@server ~]$ echo "goodbye friend" | sed -e "s/goodbye/$b/"
Where do you assign $bb?
Thanks for the reply. I am assigning bb=$a in the 2nd line.
Anyways it seems escaping the newlines did the trick.