Hello all,
I have a weird issue when trying to substitute the slashes into backslashes.
If I execute this on the command-line (bash / ksh) I get the path correctly translated with backslashes instead of slashes.
> echo $PWD | sed 's/\//\\/g'
However, when I put this in my script to have the output in the variable "newpwd" I get the error "sed: 0602-404 Function s/\//\\/g can not be parsed."
Code:
----------------------------------------------
#! /bin/sh
newpwd=`echo $PWD | sed -e 's/\//\\/g'`
echo $newpwd
----------------------------------------------
Does anyone know what's going on here?
How can I then translate the / into \ ?
Many thanks in advance!
Tom