Insert 2 lines in a file at a specific location

Hi,

I need to insert two new lines in a file:
The file:
".....
......
ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`"
....
....
"

I need to add the lines:
LD_LIBRARY_PATH='$LD_LIBRARY_PATH:$APACHE_HOME/modules'
DOWNLOADMODULE_CONF_PATHNAME='$APACHE_HOME/conf/DWLModule.cfg'

right after the above line in the file.

How can I do that ?

Thanks,
Bianca

Hi.

See the links at the bottom of this thread page ... cheers, drl

The following ed(1) script should do the job for you. You can invoke it as follows: ed file < edscript

 /^ULIMIT_MAX_FILES
a
LD_LIBRARY_PATH='$LD_LIBRARY_PATH:$APACHE_HOME/modules'
DOWNLOADMODULE_CONF_PATHNAME='$APACHE_HOME/conf/DWLModule.cfg'
.
w
q