Or .. is sed the way to go.

OK  I'm limited by what I can do in a bash shell (this is going inside
an RPM)  I'm moding the line in php.ini that sets the include directory
list.  The problems are 

1.  If the user already has some mods made to this line I don't want to
destroy them.

2.  The line has inline comments so my change is in the middle of the
line.

3.  I don't know what the line looks like (In that I don't know what's
on that users box.)  So I can't just grep out his/her mods and write a
new line.... I think.


So the question is.  Given an example old line:

location of include ".:/var/www/html/php"     # some inline comment.

How would I add/insert

:/var/www/html/newdir/php  

via script rather than VI (ok, or emacs)after php and before the "  ?

James

Sorry if this question is clear as mudd... sometimes I can show you what
I mean easier than explain...




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to