<?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: UNIX script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748236#M69552</link>
    <description>Hi Robert:&lt;BR /&gt;&lt;BR /&gt;You could use something like:&lt;BR /&gt;&lt;BR /&gt;sed -e 's/&amp;amp;request_id=[[:digit:]]*//'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Wed, 19 Jun 2002 18:19:55 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2002-06-19T18:19:55Z</dc:date>
    <item>
      <title>UNIX script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748233#M69549</link>
      <description>Hi! list,&lt;BR /&gt;I am trying to write a parsing script, how do I remove &amp;amp;_requestid=808, number is different for request ids so 's/&amp;amp;request_id=//' is not going to work.&lt;BR /&gt;[05/Jun/2002:04:29:34 /index2.jhtml/myhome/index.jhtml&amp;amp;_requestid=808    "-"&lt;BR /&gt;[05/Jun/2002:04:49:41 /index2.jhtml/myhome/index.jhtml&amp;amp;_requestid=1048    "-"&lt;BR /&gt;[05/Jun/2002:07:14:38 /index2.jhtml/myhome/index.jhtml&amp;amp;_requestid=1676    "-"&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jun 2002 18:14:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748233#M69549</guid>
      <dc:creator>Robert_73</dc:creator>
      <dc:date>2002-06-19T18:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748234#M69550</link>
      <description>How about&lt;BR /&gt;sed -e 's/&amp;amp;_requestid=.*//' &lt;INPFILE&gt;outfile&lt;BR /&gt;&lt;BR /&gt;This will remove everything past &amp;amp;_requestid&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills&lt;/INPFILE&gt;</description>
      <pubDate>Wed, 19 Jun 2002 18:17:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748234#M69550</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-06-19T18:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748235#M69551</link>
      <description>Robert,&lt;BR /&gt;&lt;BR /&gt;The regular expression "[0-9][0-9][0-9]" should match any string of three consecutive digits.&lt;BR /&gt;&lt;BR /&gt;I'm not sure how well this will display, but there are no spaces between the double quotes.  And the quotes would not be included in your search string.&lt;BR /&gt;&lt;BR /&gt;And you'll probably have to escape the &amp;amp; with a backslash:&lt;BR /&gt;&lt;BR /&gt;'s/\&amp;amp;request_id=[0-9][0-9][0-9//'&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jun 2002 18:19:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748235#M69551</guid>
      <dc:creator>Tom Dawson</dc:creator>
      <dc:date>2002-06-19T18:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748236#M69552</link>
      <description>Hi Robert:&lt;BR /&gt;&lt;BR /&gt;You could use something like:&lt;BR /&gt;&lt;BR /&gt;sed -e 's/&amp;amp;request_id=[[:digit:]]*//'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 19 Jun 2002 18:19:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748236#M69552</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-06-19T18:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748237#M69553</link>
      <description>Hi! list,&lt;BR /&gt;Thanks for the responses, but none of them are working.&lt;BR /&gt;This one will remove requestid and the other columns after that, I want to keep other columns&lt;BR /&gt;sed -e 's/&amp;amp;_requestid=.*//' &lt;INPFILE&gt;outfile &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Something like these commands should work but they are not working. &lt;BR /&gt;&lt;BR /&gt;'s/\&amp;amp;request_id=[0-9][0-9][0-9//' &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;sed -e 's/&amp;amp;request_id=[[:digit:]]*//' &lt;BR /&gt;&lt;BR /&gt;Any help is appreciated.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;/INPFILE&gt;</description>
      <pubDate>Wed, 19 Jun 2002 18:33:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748237#M69553</guid>
      <dc:creator>Robert_73</dc:creator>
      <dc:date>2002-06-19T18:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748238#M69554</link>
      <description>Robert,&lt;BR /&gt;&lt;BR /&gt;It looks like I had miss copied your test string.  You had "_requestid" and I had copied it as "request_id".  So now that I'm past that, here's what I did ( on a 10.20 system ):&lt;BR /&gt;&lt;BR /&gt;I created a file called parsing.sed:&lt;BR /&gt;&lt;BR /&gt;s/&amp;amp;_requestid=[[:digit:]]*//g&lt;BR /&gt;&lt;BR /&gt;Then I executed sed with:&lt;BR /&gt;&lt;BR /&gt;sed -f parsing.sed myfile &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;"myfile" was a cut and past of your test data above.  Note that I've incorporated James' suggestion of using [[:digit:]]*.  My first response would not have worked with numerical strings longer than three digits.  I hadn't noticed that you had examples with more than three digits.&lt;BR /&gt;&lt;BR /&gt;This worked okay for me with your test data.  My "newfile" looks like this:&lt;BR /&gt;&lt;BR /&gt;[05/Jun/2002:04:29:34 /index2.jhtml/myhome/index.jhtml "-"&lt;BR /&gt;[05/Jun/2002:04:49:41 /index2.jhtml/myhome/index.jhtml "-"&lt;BR /&gt;[05/Jun/2002:07:14:38 /index2.jhtml/myhome/index.jhtml "-"&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Jun 2002 18:54:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748238#M69554</guid>
      <dc:creator>Tom Dawson</dc:creator>
      <dc:date>2002-06-19T18:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: UNIX script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748239#M69555</link>
      <description>Hi Robert:&lt;BR /&gt;&lt;BR /&gt;I, too used the example of "request_id" and not your "requestid" string!  Is that what you missed?  Thy this:&lt;BR /&gt;&lt;BR /&gt;# echo "my&amp;amp;requestid=808alpha\nyour&amp;amp;requestid=909beta"||sed -e 's/request_id=[[:digit:]]*//'&lt;BR /&gt;&lt;BR /&gt;For output, you ahould have:&lt;BR /&gt;&lt;BR /&gt;myα&lt;BR /&gt;yourβ&lt;BR /&gt;&lt;BR /&gt;In the form using [0-9], you are missing a closing bracket "]" for the last part of the expression.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 19 Jun 2002 19:01:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-script/m-p/2748239#M69555</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-06-19T19:01:19Z</dc:date>
    </item>
  </channel>
</rss>

