<?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 in ksh in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254207#M175902</link>
    <description>&lt;BR /&gt;Hi,&lt;BR /&gt;  Maybe you still use "sed" but put a "\" before the "/".</description>
    <pubDate>Tue, 20 Apr 2004 21:25:58 GMT</pubDate>
    <dc:creator>Wilfredo R. Castro</dc:creator>
    <dc:date>2004-04-20T21:25:58Z</dc:date>
    <item>
      <title>Sed in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254203#M175898</link>
      <description>Hi&lt;BR /&gt;I am using sed command to read from a XML file and write it out in another file the problem here is i have to read above and below the tags &lt;MANIFEST&gt; ,&lt;/MANIFEST&gt; if&lt;BR /&gt;some text exists otherwise exit &lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;STARTREL=`cat $FILE|sed -n '/&lt;MANIFEST&gt;/='`&lt;BR /&gt;ENDREL=`cat $FILE|sed -n '/&amp;lt;\/Manifest&amp;gt;/='`&lt;BR /&gt;  (( STARTREL = STARTREL - 1 ))&lt;BR /&gt; (( ENDREL = ENDREL + 1 ))&lt;BR /&gt;    while&lt;BR /&gt;    [ $STARTREL -le $ENDREL ]&lt;BR /&gt;    do&lt;BR /&gt;RELNM=`cat $FILE|sed -n "$STARTREL,$STARTREL P"`&lt;BR /&gt;   $RELNM &amp;gt;&amp;gt; $RELNOTES&lt;BR /&gt;    do&lt;/MANIFEST&gt;</description>
      <pubDate>Tue, 20 Apr 2004 16:45:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254203#M175898</guid>
      <dc:creator>Vanquish</dc:creator>
      <dc:date>2004-04-20T16:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sed in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254204#M175899</link>
      <description>sed may not be the right tool. How about the following perl one liner-&lt;BR /&gt; &lt;BR /&gt;perl -ne 'print unless /^&lt;MANIFEST&gt;&lt;/MANIFEST&gt; &lt;BR /&gt;This will print all lines, except those between &lt;MANIFEST&gt; and &lt;/MANIFEST&gt;&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 20 Apr 2004 17:01:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254204#M175899</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-04-20T17:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sed in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254205#M175900</link>
      <description>&lt;BR /&gt; How about this ?&lt;BR /&gt;&lt;BR /&gt;  sed '/&lt;MANIFEST&gt;/,/&amp;lt;\/Manifest&amp;gt;/d' input &amp;gt; output&lt;/MANIFEST&gt;</description>
      <pubDate>Tue, 20 Apr 2004 17:52:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254205#M175900</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-04-20T17:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sed in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254206#M175901</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;With awk you can:&lt;BR /&gt;&lt;BR /&gt;awk '/&lt;MANIFEST&gt;/,/&amp;lt;\/Manifest&amp;gt;/ {flag=1} &lt;BR /&gt;{if (!flag) print ; flag=0} ' file_in &amp;gt; f_out&lt;BR /&gt;&lt;BR /&gt;Frank.&lt;/MANIFEST&gt;</description>
      <pubDate>Tue, 20 Apr 2004 18:17:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254206#M175901</guid>
      <dc:creator>Francisco J. Soler</dc:creator>
      <dc:date>2004-04-20T18:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sed in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254207#M175902</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;  Maybe you still use "sed" but put a "\" before the "/".</description>
      <pubDate>Tue, 20 Apr 2004 21:25:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254207#M175902</guid>
      <dc:creator>Wilfredo R. Castro</dc:creator>
      <dc:date>2004-04-20T21:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sed in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254208#M175903</link>
      <description>In Korn Shell,&lt;BR /&gt;&lt;BR /&gt;The best to use if there are such characters is ";",&lt;BR /&gt;&lt;BR /&gt;i.e.&lt;BR /&gt;&lt;BR /&gt;cat kapilraj |sed -e "s;BAD BOY;GOODBOY;g"&lt;BR /&gt;&lt;BR /&gt;Regds,&lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Tue, 20 Apr 2004 23:53:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254208#M175903</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2004-04-20T23:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sed in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254209#M175904</link>
      <description>Your problem is the while loop, I guess.&lt;BR /&gt;&lt;BR /&gt;STARTREL and ENDREL might both contain multiple entries. If not, you can replace the while with an if. You even should replace the test with something like:&lt;BR /&gt;[ "0$STARTREL" -le "0$ENDREL" ]&lt;BR /&gt;&lt;BR /&gt;There are more problems in this script, btw. So I would recommend looking at the solutions given so far. perl and awk are languages that have this problem solved easily, for instance:&lt;BR /&gt;awk '/&lt;MANIFEST&gt;/,/&amp;lt;\/Manifest&amp;gt;/ {print}' &amp;lt; $FILE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/MANIFEST&gt;</description>
      <pubDate>Wed, 21 Apr 2004 03:32:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254209#M175904</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-04-21T03:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Sed in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254210#M175905</link>
      <description>Hi&lt;BR /&gt;awk '/&lt;MANIFEST&gt;/,/&amp;lt;\/Manifest&amp;gt;/'filein &amp;gt;file out works reverse&lt;BR /&gt;it copies what is in between the tags i want to copy what in not between the tags&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;/MANIFEST&gt;</description>
      <pubDate>Wed, 21 Apr 2004 13:41:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254210#M175905</guid>
      <dc:creator>Vanquish</dc:creator>
      <dc:date>2004-04-21T13:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sed in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254211#M175906</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;See my previus answer.&lt;BR /&gt;&lt;BR /&gt;Frank.</description>
      <pubDate>Wed, 21 Apr 2004 17:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254211#M175906</guid>
      <dc:creator>Francisco J. Soler</dc:creator>
      <dc:date>2004-04-21T17:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sed in ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254212#M175907</link>
      <description>Hi&lt;BR /&gt;I used &lt;BR /&gt;perl -ne 'print unless /^&lt;MANIFEST&gt;&lt;/MANIFEST&gt;it works, but it prints out not as orignal&lt;BR /&gt;format i want to print it in orignal format.&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Apr 2004 09:19:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-in-ksh/m-p/3254212#M175907</guid>
      <dc:creator>Vanquish</dc:creator>
      <dc:date>2004-04-22T09:19:07Z</dc:date>
    </item>
  </channel>
</rss>

