<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: sed question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162519#M684672</link>
    <description>Thanks All!!!</description>
    <pubDate>Wed, 11 Mar 2009 00:09:38 GMT</pubDate>
    <dc:creator>Allanm</dc:creator>
    <dc:date>2009-03-11T00:09:38Z</dc:date>
    <item>
      <title>sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162513#M684666</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;I want to add line y after line x in httpd.conf file but struggling with it... &lt;BR /&gt;&lt;BR /&gt;line x #CustomLog logs/localhost/access_log combined&lt;BR /&gt;&lt;BR /&gt;line y CustomLog "|/bin/cat - &amp;gt;&amp;gt;  /apache/logs/localhost/access_log"  combined&lt;BR /&gt;&lt;BR /&gt;Can you suggest a sed one liner for this. Mine doesnt work and gives wierd behaviour - &lt;BR /&gt;&lt;BR /&gt;sed '=#CustomLog logs\/localhost\/access_log combined= a\CustomLog \"\|\/bin\/cat \- \&amp;gt;\&amp;gt;  \/apache\/logs\/localhost\/access_log\" combined' httpd.conf &amp;gt;&amp;gt; httpd.conf.2&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allanm</description>
      <pubDate>Tue, 10 Mar 2009 20:58:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162513#M684666</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-03-10T20:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162514#M684667</link>
      <description>Please Help!</description>
      <pubDate>Tue, 10 Mar 2009 21:20:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162514#M684667</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-03-10T21:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162515#M684668</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if this is a one-timer, use vi.&lt;BR /&gt;If this has to be done in a script:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;{&lt;BR /&gt;print "/CustomLog logs\/localhost\/access_log combined/a"&lt;BR /&gt;print 'CustomLog "|/bin/cat - &amp;gt;&amp;gt; /apache/logs/localhost/access_log" combined'&lt;BR /&gt;print '.\nw'&lt;BR /&gt;} | ed - http.conf&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;&lt;BR /&gt;PS: untested</description>
      <pubDate>Tue, 10 Mar 2009 21:30:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162515#M684668</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2009-03-10T21:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162516#M684669</link>
      <description>You have an interesting set of strings that are going to call for some escapes, but in general this would be done in sed as a straight append command:&lt;BR /&gt;&lt;BR /&gt;sed -e '/^TargetString/a\&lt;BR /&gt;Appended string here'&lt;BR /&gt;&lt;BR /&gt;Your string has so many quotes and slashes that it will take me a minute.   If you do not need to match on the whole string that would certainly help.&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Mar 2009 21:30:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162516#M684669</guid>
      <dc:creator>Bob E Campbell</dc:creator>
      <dc:date>2009-03-10T21:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162517#M684670</link>
      <description>sed -e '/^#CustomLog logs\/localhost\/access_log combined/ a\&lt;BR /&gt;CustomLog "|/bin/cat - &amp;gt;&amp;gt; /apache/logs/localhost/access_log combined"&lt;BR /&gt;'</description>
      <pubDate>Tue, 10 Mar 2009 21:32:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162517#M684670</guid>
      <dc:creator>Bob E Campbell</dc:creator>
      <dc:date>2009-03-10T21:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162518#M684671</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You could do:&lt;BR /&gt;&lt;BR /&gt;# perl -ne 'if (/^#CustomLog/) {print;print qq(INSERT_ &amp;gt; "SOME" &amp;lt; _LINE\n)} else {print}' file&lt;BR /&gt;&lt;BR /&gt;...Notice that the line to be inserted actually looks like:&lt;BR /&gt;&lt;BR /&gt;INSERT_ &amp;gt; "SOME" &amp;lt; _LINE&lt;BR /&gt;&lt;BR /&gt;...that is, you are free to put any string you want in its place, thus, you want:&lt;BR /&gt;&lt;BR /&gt;# perl -ne 'if (/^#CustomLog/) {print;print qq(CustomLog "|/bin/cat - &amp;gt;&amp;gt; /apache/logs/localhost/access_log" combined\n)} else {print}' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 10 Mar 2009 22:00:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162518#M684671</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-10T22:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162519#M684672</link>
      <description>Thanks All!!!</description>
      <pubDate>Wed, 11 Mar 2009 00:09:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-question/m-p/5162519#M684672</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-03-11T00:09:38Z</dc:date>
    </item>
  </channel>
</rss>

