Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    he-llo friend
    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?


  2. #2
    [root@server ~]$ bb="30-APR-10"
    [root@server ~]$ echo "goodbye friend" | sed -e "s/goodbye/$b/"
    30-APR-10 friend
    [root@server ~]$
    So I don't see any problems.
    Where do you assign $bb?

  3. #3
    Thanks for the reply. I am assigning bb=$a in the 2nd line.

    Anyways it seems escaping the newlines did the trick.


    Thanks again.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts