In both cases, my Cygwin and my Linux box (Debian) have the same problem:
I am working in a shell script with some formatting identifiers, I want to add a backslash () before the appearance of a slash (/).
My sed script works well on my terminal:
# export someid="314-12345/08"
# echo "${someid}" | sed 's/\//\\\//'
Output:
314-12345\/08
But not so if I ran command substitution :
# someidformatted=`echo "${someid}" | sed 's/\//\\\//'`
sed: -e expression #1, char 9: unknown option to `s'
What am I missing here?
Thanks in advance.
source
share