<?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: Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814691#M85227</link>
    <description>or in ksh&lt;BR /&gt;&lt;BR /&gt;grep SEV inputfile |&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;  line=${line#*SEV}&lt;BR /&gt;  print "SEV $line"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;this will print from the first occurance of SEV</description>
    <pubDate>Fri, 27 Sep 2002 04:32:25 GMT</pubDate>
    <dc:creator>curt larson_1</dc:creator>
    <dc:date>2002-09-27T04:32:25Z</dc:date>
    <item>
      <title>Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814688#M85224</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a requirement. I want to grep the lines which contains SEV word and from that output I want to cut SEV to end of the line.&lt;BR /&gt;Ex:&lt;BR /&gt;&lt;BR /&gt;SEV word1 word2&lt;BR /&gt;Word1 SEV Word2 &lt;BR /&gt;Word1 word2 SEV word4 word4&lt;BR /&gt;word word word without SEV&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Sep 2002 04:05:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814688#M85224</guid>
      <dc:creator>SAM_24</dc:creator>
      <dc:date>2002-09-27T04:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814689#M85225</link>
      <description>how about using sed&lt;BR /&gt;&lt;BR /&gt;sed 's/\(.*\)\(SEV\)\(.*\)/\2\3/p' &amp;lt; inputfile&lt;BR /&gt;&lt;BR /&gt;but if there is more then one occurance of this will print from the last occurance to the end of the line.</description>
      <pubDate>Fri, 27 Sep 2002 04:21:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814689#M85225</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2002-09-27T04:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814690#M85226</link>
      <description>or in ksh&lt;BR /&gt;&lt;BR /&gt;grep SEV inputfile |&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;  line=${line#*SEV}&lt;BR /&gt;  print "SEV $line"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;this will print from the first occurance of SEV</description>
      <pubDate>Fri, 27 Sep 2002 04:28:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814690#M85226</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2002-09-27T04:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814691#M85227</link>
      <description>or in ksh&lt;BR /&gt;&lt;BR /&gt;grep SEV inputfile |&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;  line=${line#*SEV}&lt;BR /&gt;  print "SEV $line"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;this will print from the first occurance of SEV</description>
      <pubDate>Fri, 27 Sep 2002 04:32:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814691#M85227</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2002-09-27T04:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814692#M85228</link>
      <description>Hi curt,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.&lt;BR /&gt;I tried first option. It is working fine. I had to add -n option with sed.&lt;BR /&gt;If possible can you tell what sed command does.&lt;BR /&gt;I am not getting.&lt;BR /&gt;&lt;BR /&gt;Raj</description>
      <pubDate>Fri, 27 Sep 2002 04:38:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814692#M85228</guid>
      <dc:creator>SAM_24</dc:creator>
      <dc:date>2002-09-27T04:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814693#M85229</link>
      <description>s does a substitution.  s/pattern/replacement/flags&lt;BR /&gt;this substitutes 'replacement' for 'pattern'.  the p flag prints the line if a successful substitution is done.&lt;BR /&gt;&lt;BR /&gt;the regular expersion used for the pattern consists of:&lt;BR /&gt;'.' which matches any single character except newline.&lt;BR /&gt;'*' which matches any number (including zero) of the single character (including a character specified by a regular expression) that immediately precedes it.&lt;BR /&gt;&lt;BR /&gt;\(\) saves the pattern enclosed between '\(' and '\)' into a special holding space (to a maximum of nine).  They can be replayed in substitutions by the escape sequences \1 to \9.&lt;BR /&gt;&lt;BR /&gt;\n matches the nth pattern previously saved by '\(' and '\)', where the previously saved patterns are counted from the left on the line.&lt;BR /&gt;&lt;BR /&gt;so this substitution breaks the line into 3 patterns. .* for everything up to SEV. (this does means the line cannot begin with SEV). Then SEV and lastly everything after SEV (has to have at least one character).  So, for the substitution to be performed the line must have a least one character before SEV and at least one character after. In which case the patterns 2 (SEV) and # (everything after SEV) will be printed.&lt;BR /&gt;&lt;BR /&gt;a more exact sed command would be:&lt;BR /&gt;sed -e '/^SEV .*/p' -e 's/\(.*\)\(SEV .*\)/\2/p'&lt;BR /&gt;&lt;BR /&gt;this will print the line if it starts with SEV, a blank and at least one character.  The substitution will print from SEV to the end of the line only if SEV is followed by a blank space and at least one more character.&lt;BR /&gt;&lt;BR /&gt;my previous sed command&lt;BR /&gt;sed 's/\(.*\)\(SEV\)\(.*\)/\2\3/p' sort of cheats a bit SEV followed by just a blank character will be printed. The cheat assumes that if there is a blank space it will be followed by a word.</description>
      <pubDate>Fri, 27 Sep 2002 05:14:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814693#M85229</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2002-09-27T05:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814694#M85230</link>
      <description>Thank you. Greatly appreciated.</description>
      <pubDate>Fri, 27 Sep 2002 22:37:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814694#M85230</guid>
      <dc:creator>SAM_24</dc:creator>
      <dc:date>2002-09-27T22:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814695#M85231</link>
      <description>Appreciation is expressed in points :)&lt;BR /&gt;&lt;BR /&gt;N/A</description>
      <pubDate>Sun, 29 Sep 2002 14:36:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2814695#M85231</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-09-29T14:36:14Z</dc:date>
    </item>
  </channel>
</rss>

