The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 03-18-2008
era
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
sed allows alternative separators for precisely this reason.

Code:
sed -e "s%${ORACLE_SID}:${ORACLE_HOME}%${ORACLE_SID}:${NEW_HOME}%g
It's "turtles all the way down" if you can't find a character which is guaranteed not to be in the replacement strings, though.

I have been known to write sed scripts which write sed scripts with all the special characters in the input backslashed, but there are obviously more elegant solutions. (Perl comes to mind, and should be easy to get started with if you know sed.)