Mailinglist Archive: opensuse (3378 mails)

< Previous Next >
Re: [SLE] [BASH] Need help replacing multiple lines
  • From: Alexandr Malusek <Alexandr.Malusek@xxxxxxxxxx>
  • Date: 12 Apr 2002 19:28:34 +0200
  • Message-id: <86662whlml.fsf@xxxxxxxxxxxxxxxxx>
JW <jw@xxxxxxxxxxxxxxxxxx> writes:

> I'm trying to use a script that adds several lines into the middle
> of httpd.conf. I thought I could use the following:
>
> cat httpd.conf | sed -e "s@ AddType application/x-tar .tgz@'$( cat lines_to_add.txt )'@g"

Experiment with

$ sed -e '/AddType application\/x-tar .tgz/r lines_to_add.txt' < httpd.conf

> Anyone have an idea what else I can do?

Read a documentation about sed (man page may not be enough).

--
Alexandr.Malusek@xxxxxxxxxx

< Previous Next >
This Thread
References