ubuntu@ubuntu-laptop:~$ echo "sdsds" > 1.txt ; sed
"s/d/\/home\/ubuntu/g" < 1.txt ; sed "s/d/ ${PWD//\//\\\/}/g" 1.txt
s/home/ubuntus/home/ubuntus
sed: -e expression #1, char 9: unknown option to `s'
ubuntu@ubuntu-laptop:~$ echo ${PWD//\//\\\/}
\/home\/ubuntu
ubuntu@ubuntu-laptop:~$ echo ${PWD//\//\\\/}
\/home\/ubuntu
ubuntu@ubuntu-laptop:~$ sed --version
GNU sed version 4.2.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.
GNU sed home page: <http://www.gnu.org/software/sed/>.
General help using GNU software: <http://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-gn...@gnu.org>.
Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.
Thank you for your help.
> i know i am doing stupid things. :)
>
> ubuntu@ubuntu-laptop:~$ echo "sdsds" > 1.txt ; sed
> "s/d/\/home\/ubuntu/g" < 1.txt ; sed "s/d/ ${PWD//\//\\\/}/g" 1.txt
> s/home/ubuntus/home/ubuntus
> sed: -e expression #1, char 9: unknown option to `s'
>
> ubuntu@ubuntu-laptop:~$ echo ${PWD//\//\\\/}
> \/home\/ubuntu
$ printf "%s\n" "${PWD//\//\\\/}"
\\/home\\/andreas
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."