The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 12-12-2006
sakthi.abdullah sakthi.abdullah is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 22
sed converting / to \/

Hi all,
I am using sed for converting a string of type /abc/def/gh by \/abc\/def\/gh

[trainee@LINUX ~]$ edu="/home/abc/dec"

When I echo that variable and pass it to sed ,it works fine...
[trainee@LINUX ~]$ echo $edu|sed 's/\//\\\//g'
\/home\/abc\/dec

But When I try to store in a variable , it shows the following error
[trainee@LINUX ~]$ ued=`echo $edu|sed 's/\//\\\//g'`
sed: -e expression #1, char 9: unknown option to `s'

HELP BLEAZ

Last edited by sakthi.abdullah; 12-12-2006 at 09:23 AM..