Advertisement

07.05.2008 at 06:17AM PDT, ID: 23540594
[x]
Attachment Details

Using the command 'sed'

Asked by Simon336697 in Shell Scripting, Linux, Perl Programming Language

Hi guys hope u can help.

I have a file called test1.php as follows....

=================================================== test1.php

//# ooIT-AUDITINGPLACEHOLDERoo1 #

                case 'menu3_it_auditing_computers.php':
                case '/simeswiki/menu3_it_auditing_disk.php':
                case '/simeswiki/menu3_it_auditing_groups.php':
                case '/simeswiki/menu3_it_auditing_networking.php':
                case '/simeswiki/menu3_it_auditing_users.php':
                case '/simeswiki/menu3_it_auditing_vmware.php':

//# ooIT-AUDITINGPLACEHOLDERoo2 #
etc
etc
etc
==============================================================

What id like to do is to:

1) Use the command 'sed' to find the following string:
//# ooIT-AUDITINGPLACEHOLDERoo1 #

2) Once found,
Remove all lines between
//# ooIT-AUDITINGPLACEHOLDERoo1 #
and
//# ooIT-AUDITINGPLACEHOLDERoo2 #

so the result is:

//# ooIT-AUDITINGPLACEHOLDERoo1 #
//# ooIT-AUDITINGPLACEHOLDERoo2 #

Any help greatly appreciated.
I dont want a new file created, but just to modify this existing file.
Thank you.

Start Free Trial
[+][-]07.05.2008 at 07:44AM PDT, ID: 21937220

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.05.2008 at 07:48AM PDT, ID: 21937238

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Shell Scripting, Linux, Perl Programming Language
Sign Up Now!
Solution Provided By: Mysidia
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.05.2008 at 09:49AM PDT, ID: 21937577

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.05.2008 at 06:26PM PDT, ID: 21938997

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628