On Fri, 18 Mar 2011 17:46:04 +0000
Joao Ferreira gmail <joao.miguel.c.ferre...@gmail.com> wrote:

>jmf@squeeje:~$ sed s/bbbb.*/bbbb:$PWD/ text.txt
>sed: -e expression #1, char 16: unknown option to `s'

Hello,

this is because $PWD gets expanded by shell before sed gets called, so what
actually gets executed is:

sed s/bbb.*/bbbb:/home/myself/ text.txt

...which is obviously syntactically incorrect.

To get result you want, try using different separator character than /, for
example the comma, or underscore:

$ sed s,bbb.*,bbbb:$PWD, text.txt
$ sed s_bbb.*_bbbb:$PWD_ text.txt

-- 
Andrej Kacian


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110318185908.2f959df8@penny

Reply via email to