Hey There,
With the variable assignment, you've got another level of escaping to do, and, admittedly, it can get confusing
Sometimes a good idea is to use a substitute character for the delimiter (like %, so you would write sed 's%this%that%') to reduce confusion.
In any event, this should do it for you
Quote:
-bash-3.2$ echo $path | sed 's/\//\/\\/g'
/\home/\xyz/\abc
-bash-3.2$ somepath=`echo $path | sed 's/\\//\\/\\\/g'`
-bash-3.2$ echo $somepath
/\home/\xyz/\abc
|
Best wishes,
Mike