Re: Re: need help with sed problem

2011-03-19 Thread Clive Standbridge
> i agree with that - the underscore that was used is also valid. you > might look at proper quoting of variables to avoid this. something > like cat text.txt | sed -e 's/bbb.*/:"$PWD"/' > new.txt The output from that, given Joao's original text.txt, is :"$PWD" The reason is t

Re: need help with sed problem

2011-03-18 Thread shawn wilson
On Fri, Mar 18, 2011 at 7:05 PM, Dr. Ed Morbius wrote: > on 19:08 Fri 18 Mar, Joao Ferreira gmail (joao.miguel.c.ferre...@gmail.com) > wrote: > > On Fri, 2011-03-18 at 18:59 +0100, Andrej Kacian wrote: > > > On Fri, 18 Mar 2011 17:46:04 + > > > Joao Ferreira gmail wrote: > > Please note that

Re: need help with sed problem

2011-03-18 Thread Dr. Ed Morbius
on 19:08 Fri 18 Mar, Joao Ferreira gmail (joao.miguel.c.ferre...@gmail.com) wrote: > On Fri, 2011-03-18 at 18:59 +0100, Andrej Kacian wrote: > > On Fri, 18 Mar 2011 17:46:04 + > > Joao Ferreira gmail wrote: > > > > >jmf@squeeje:~$ sed s/.*/:$PWD/ text.txt > > >sed: -e expression #1,

Re: need help with sed problem

2011-03-18 Thread Joao Ferreira gmail
On Fri, 2011-03-18 at 18:59 +0100, Andrej Kacian wrote: > On Fri, 18 Mar 2011 17:46:04 + > Joao Ferreira gmail wrote: > > >jmf@squeeje:~$ sed s/.*/:$PWD/ text.txt > >sed: -e expression #1, char 16: unknown option to `s' > > Hello, > > this is because $PWD gets expanded by shell befo

Re: need help with sed problem

2011-03-18 Thread Boyd Stephen Smith Jr.
On 2011-03-18 12:59:08 Andrej Kacian wrote: >To get result you want, try using different separator character than /, for >example the comma, or underscore: Colon is also a pretty good choice. While it is allowed in pathnames, it already causes problems. Try adding a directory containing colon t

Re: need help with sed problem

2011-03-18 Thread Andrej Kacian
On Fri, 18 Mar 2011 17:46:04 + Joao Ferreira gmail wrote: >jmf@squeeje:~$ sed s/.*/:$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.*/:/

need help with sed problem

2011-03-18 Thread Joao Ferreira gmail
Hello all I need to use sed to replace a given line in a text file with the current working directory. But this is getting quite tricky. Problem ilustrated below: $ cat text.txt :/some/wrong/path/ $ sed s/.*/:$TERM/ text.txt :x

Re: find -execdir + sed problem

2009-01-08 Thread Alex Samad
On Thu, Jan 08, 2009 at 12:03:38PM +0200, Micha Feigin wrote: > I'm trying to fix the file suffix on some file in my directories using sed and > find but for some reason sed doesn't match the string in this manner, that is > running > find . -name "*.JPG.jpg" -execdir echo `echo '{}' | sed -e > 's

Re: find -execdir + sed problem

2009-01-08 Thread Micha Feigin
On Thu, 08 Jan 2009 11:24:27 +0100 Sven Joachim wrote: > On 2009-01-08 11:03 +0100, Micha Feigin wrote: > > > I'm trying to fix the file suffix on some file in my directories using sed > > and find but for some reason sed doesn't match the string in this manner, > > that is running > > find . -n

Re: find -execdir + sed problem

2009-01-08 Thread Rainer Kluge
Bob Cox schrieb: On Thu, Jan 08, 2009 at 12:03:38 +0200, Micha Feigin (mi...@post.tau.ac.il) wrote: find . -type f -exec echo `echo '{}' | tr "[:upper:]" "[:lower:]"` \; also fails to convert the file to lower case for some reason (same problem, doesn't change the case, as if it doesn't see th

Re: find -execdir + sed problem

2009-01-08 Thread Bob Cox
On Thu, Jan 08, 2009 at 12:03:38 +0200, Micha Feigin (mi...@post.tau.ac.il) wrote: > I'm trying to fix the file suffix on some file in my directories using sed and > find but for some reason sed doesn't match the string in this manner, that is > running > find . -name "*.JPG.jpg" -execdir echo `

Re: find -execdir + sed problem

2009-01-08 Thread Bob Cox
On Thu, Jan 08, 2009 at 12:03:38 +0200, Micha Feigin (mi...@post.tau.ac.il) wrote: > find . -type f -exec echo `echo '{}' | tr "[:upper:]" "[:lower:]"` \; > > also fails to convert the file to lower case for some reason (same problem, > doesn't change the case, as if it doesn't see the characte

Re: find -execdir + sed problem

2009-01-08 Thread Sven Joachim
On 2009-01-08 11:03 +0100, Micha Feigin wrote: > I'm trying to fix the file suffix on some file in my directories using sed and > find but for some reason sed doesn't match the string in this manner, that is > running > find . -name "*.JPG.jpg" -execdir echo `echo '{}' | sed -e > 's/\(.*\).JPG.jp

find -execdir + sed problem

2009-01-08 Thread Micha Feigin
I'm trying to fix the file suffix on some file in my directories using sed and find but for some reason sed doesn't match the string in this manner, that is running find . -name "*.JPG.jpg" -execdir echo `echo '{}' | sed -e 's/\(.*\).JPG.jpg/\1.jpg/' -` \; on a directory with 2005_10_09-03_05_11.J

Re: sed problem

2003-10-21 Thread Floris Bruynooghe
On Mon, Oct 20, 2003 at 10:09:47PM +0100, Dave selby wrote: > >I need to get the contents of a HTML title tag & put it in a string. > > > >ie > >specialist cards > > > >I need the "specialist cards" in a variable $titlecontents > >I thought it would be easy with sed > > > >sed -n '//,/<\/title>/p'

Re: sed problem

2003-10-20 Thread Dave selby
Dave selby wrote: I need to get the contents of a HTML title tag & put it in a string. ie specialist cards I need the "specialist cards" in a variable $titlecontents I thought it would be easy with sed sed -n '//,/<\/title>/p' But no go. I have tried various ways but to no avail. Any ideas ?

Re: sed problem

2003-10-19 Thread Bijan Soleymani
On Sun, Oct 19, 2003 at 11:37:44AM +0100, Dave selby wrote: > I need to get the contents of a HTML title tag & put it in a string. > > ie > specialist cards > > I need the "specialist cards" in a variable $titlecontents > I thought it would be easy with sed > > sed -n '//,/<\/title>/p' > > But

Re: sed problem

2003-10-19 Thread Michael D Schleif
Dave selby <[EMAIL PROTECTED]> [2003:10:19:11:37:44+0100] scribed: > I need to get the contents of a HTML title tag & put it in a string. > > ie > specialist cards > > I need the "specialist cards" in a variable $titlecontents > I thought it would be easy with sed > > sed -n '//,/<\/title>/p' >

Re: sed problem

2003-10-19 Thread Andre Kalus
On Sun, 19 Oct 2003 11:37:44 +0100, Dave selby wrote: > I need to get the contents of a HTML title tag & put it in a string. > > ie > specialist cards > > I need the "specialist cards" in a variable $titlecontents I thought it > would be easy with sed > > sed -n '//,/<\/title>/p' > > But no g

Re: sed problem

2003-10-19 Thread David Jardine
On Sun, Oct 19, 2003 at 11:37:44AM +0100, Dave selby wrote: > I need to get the contents of a HTML title tag & put it in a string. > > ie > specialist cards > > I need the "specialist cards" in a variable $titlecontents > I thought it would be easy with sed > > sed -n '//,/<\/title>/p' > > But

sed problem

2003-10-19 Thread Dave selby
I need to get the contents of a HTML title tag & put it in a string. ie specialist cards I need the "specialist cards" in a variable $titlecontents I thought it would be easy with sed sed -n '//,/<\/title>/p' But no go. I have tried various ways but to no avail. Any ideas ? Dave -- To UNSUBSC

Re: OT: Makefile & sed-Problem

2003-10-06 Thread Lukas Ruf
> Oliver Elphick <[EMAIL PROTECTED]> [2003-10-06 14:09]: > > On Mon, 2003-10-06 at 12:31, Lukas Ruf wrote: > > You are trying to use a Perl regular expression with sed; that doesn't > work. Although the sed manpage refers to perlre, sed does not seem to > support Perl regular expressions. You sh

Re: OT: Makefile & sed-Problem

2003-10-06 Thread Oliver Elphick
On Mon, 2003-10-06 at 12:31, Lukas Ruf wrote: > Dear all, > > although I know it isn't anything that directly refers to Debian, I > dare to post since I have seen many similar questions. Please excuse! It's not off topic for debian-user. > The Problem: from a friend, I receive text-files that h

OT: Makefile & sed-Problem

2003-10-06 Thread Lukas Ruf
Dear all, although I know it isn't anything that directly refers to Debian, I dare to post since I have seen many similar questions. Please excuse! The Problem: from a friend, I receive text-files that have a lot of whitespace before the end of a line or even lines consisting of only whitespace.

Further SED problem

2003-10-05 Thread Dave selby
Im may be trying to push SED to far, in which case perl has been suggested, but here is my problem ... For a series of html pages, I need to take the text from the title tag and insert it where there is a xx in the document, deleting the xx. Ie use a template, fill in the title & let SED do the

Re: SED problem

2003-10-05 Thread Dave selby
Bijan Soleymani wrote: On Sat, Oct 04, 2003 at 07:25:32PM +0100, Dave selby wrote: I have multiple html files. I need to remove the same chunk of code from all of them. I have made a bash loop to feed the files to sed, but am struggling with the sed code. I need to delete all the code betwee

Re: SED problem

2003-10-05 Thread Dave selby
Michael D Schleif wrote: Michael D Schleif <[EMAIL PROTECTED]> [2003:10:04:16:32:37-0500] scribed: Dave selby <[EMAIL PROTECTED]> [2003:10:04:19:25:32+0100] scribed: I have multiple html files. I need to remove the same chunk of code from all of them. I have made a bash loop to feed the f

Re: SED problem

2003-10-04 Thread Michael D Schleif
Michael D Schleif <[EMAIL PROTECTED]> [2003:10:04:16:32:37-0500] scribed: > Dave selby <[EMAIL PROTECTED]> [2003:10:04:19:25:32+0100] scribed: > > I have multiple html files. I need to remove the same chunk of code from > > all of them. > > I have made a bash loop to feed the files to sed, but am

Re: SED problem

2003-10-04 Thread Michael D Schleif
Dave selby <[EMAIL PROTECTED]> [2003:10:04:19:25:32+0100] scribed: > I have multiple html files. I need to remove the same chunk of code from > all of them. > I have made a bash loop to feed the files to sed, but am struggling with > the sed code. > > I need to delete all the code between > >

Re: SED problem

2003-10-04 Thread Bijan Soleymani
On Sat, Oct 04, 2003 at 07:25:32PM +0100, Dave selby wrote: > I have multiple html files. I need to remove the same chunk of code from > all of them. > I have made a bash loop to feed the files to sed, but am struggling with > the sed code. > > > I need to delete all the code between > > > >

SED problem

2003-10-04 Thread Dave selby
I have multiple html files. I need to remove the same chunk of code from all of them. I have made a bash loop to feed the files to sed, but am struggling with the sed code. I need to delete all the code between and Including the above comments. I have tried, played with N, d substitution to