Sed question

Dave Tiger dave at tigeri.com
Thu Apr 15 18:23:32 BST 2004


Hi Chris,

Starting to think the same thing. Looks like I am off to compile a command
line Php and sort this out in two minutes flat :-)

Thanks for the reply

Dave C



-----Original Message-----
From: Chris Rodgers [mailto:chris at rodgers.org.uk] 
Sent: 15 April 2004 16:35
To: Dave Tiger
Subject: Re: Sed question


Dave

Please don't take offence, but you would very likely be better off either
using PHP on the command line or PERL and DBI. Every time I ahve tried to
write a shell script which does significant text or numerical processing I
have found that the work ends up escalating. For example, shell scripts are
unusually fragile if you have spaces or other special characters in your
database fields (you must set the IFS variable
appropriately) and you seem to end up jumping through innumerable hoops.

Just my twopence...

Chris Rodgers

On Thu, 2004-04-15 at 15:25, Dave Tiger wrote:
> Hi Again,
> 
> Sorry to be a bore but I cant get my head around sed and adding text 
> to a file using it.
> 
> I need to find the instance of "domain.com-edit" which is at the end 
> of a line in a file and add a line of text under it.
> 
> Sed -e "domain.com-edit" -e "s/text to add/g" filename
> 
> Dose not work, I got the example of a website.
> 
> Any help with this last piece of the puzzle is appreciated.
> 
> Thank you in advance
> 
> Dave C
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.657 / Virus Database: 422 - Release Date: 13/04/2004
>  
> 
> 
> ------ FreeBSD UK Users' Group  -  Mailing List ------ 
> http://listserver.uk.freebsd.org/mailman/listinfo/freebsd-users


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.657 / Virus Database: 422 - Release Date: 13/04/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.657 / Virus Database: 422 - Release Date: 13/04/2004
 





More information about the Ukfreebsd mailing list