Re: [SLUG] sed help please

2000-08-21 Thread Ken Yap
>Yes, the s/'/"/g was an error, but the true problem was that there was a >"/" character in one of the variables being substituted in and the regexp >was getting confused over that. This is why it's important to report the exact problem. If you had had an extra / in the s command, sed would have

Re: [SLUG] sed help please

2000-08-21 Thread Howard Lowndes
Further still. What I had to end up doing was using different delimiters instead of "/" -- Howard. __ LANNet Computing Associates On Tue, 22 Aug 2000, Howard Lowndes wrote: > Tks for the help folks. > > Yes, the s

Re: [SLUG] sed help please

2000-08-21 Thread Howard Lowndes
Tks for the help folks. Yes, the s/'/"/g was an error, but the true problem was that there was a "/" character in one of the variables being substituted in and the regexp was getting confused over that. -- Howard. __ LANNet Computing Associate

Re: [SLUG] sed help please

2000-08-21 Thread Jim Clark
On Tue, 22 Aug 2000, you wrote: > ; $CHARS is not being expanded when enclosed within single quotes. > ; > ; try: > ; sed -e "s?CHARS?$CHARS?g" > > firstly, you don't need the -e. good point. > secondly, there's no need for an > alternate pattern/replacement seperator, sed is smart enough to >

Re: [SLUG] sed help please

2000-08-21 Thread Russell Davies
; $CHARS is not being expanded when enclosed within single quotes. ; ; try: ; sed -e "s?CHARS?$CHARS?g" firstly, you don't need the -e. secondly, there's no need for an alternate pattern/replacement seperator, sed is smart enough to recognise that when '$' is followed by something, it doesn't de

Re: [SLUG] sed help please

2000-08-21 Thread Jim Clark
On Tue, 22 Aug 2000, Howard Lowndes wrote: > This is an example of a script I am trying to put together: > > #!/bin/sh > PATH=/bin:/sbin:/usr/bin:/usr/sbin > . /etc/site-params > ssed -e 's/CHARS/$CHARS/g' this.file > > $CHARS is not being expanded when enclosed within single quotes. try: sed

Re: [SLUG] sed help please

2000-08-21 Thread Ken Yap
>#!/bin/sh >PATH=/bin:/sbin:/usr/bin:/usr/sbin >. /etc/site-params >sed -e 's/CHARS/$CHARS/g' this.file > >All it achieves though is to replace the string CHARS with the string >$CHARS, which is not what I want. This is where the difference between " and ' matters. -- SLUG - Sydney Linux User G

Re: [SLUG] sed help please

2000-08-21 Thread John Ferlito
On Tue, Aug 22, 2000 at 01:11:48PM +1000, Howard Lowndes wrote: > This is an example of a script I am trying to put together: > > #!/bin/sh > PATH=/bin:/sbin:/usr/bin:/usr/sbin > . /etc/site-params > sed -e 's/CHARS/$CHARS/g' this.file try sed -e "s/CHARS/$CHARS/g" this.file If you use

[SLUG] sed help please

2000-08-21 Thread Howard Lowndes
This is an example of a script I am trying to put together: #!/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin . /etc/site-params sed -e 's/CHARS/$CHARS/g' this.file Line 3 puts the variable CHARS into the local environment. What I then want the sed to do is to run thru this.file and replace all occ