On Fri, 2011-03-18 at 18:59 +0100, Andrej Kacian wrote: > 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
Thanks a lot... I did not know that was possible... I used the # separator. Worked just fine Thank you Joao > > -- > 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/1300475305.2285.0.ca...@squeeje.critical.pt