> I'd do it very clearly in two lines:
>
> $ perl -ni -e 'print unless /^# BEGIN project/../^# END project/' 
> /etc/rc.machine
> $ cat rc-addition >>/etc/rc.machine
>

Jay Plett also emailed me a similar solution using sed which I'd touch up as:

sed -ibak -e '/^# BEGIN project/,/^# END project/d' -e '$r
rc-addition' /etc/rc.machine

I think both are equally readable.  I like Jay's solution to use the
"r" command to read the file in at the end.

Thanks!

Tom
_______________________________________________
Discuss mailing list
Discuss@lopsa.org
http://lopsa.org/cgi-bin/mailman/listinfo/discuss
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to