<?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: Scripting question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206966#M678440</link>
    <description>Old School,&lt;BR /&gt;&lt;BR /&gt;your right I need to keep the integrity of the file,  I have used sed to amend all the other entries,  the issue I have is I need to either multiply or divide the number assoiciated with PP=  while keeping the rest of the file intact.  I could use awk  but that strips the rest of the file.  and I dont believe you can use mathamatical options in sed?  saying that I am not a sed expert, but I dont think so.  If awk has an option to show the whole file while manipulating the figure then that would be my solution,  but again I dont believe it does.?&lt;BR /&gt;&lt;BR /&gt;Any ideas cause I'm stumped.</description>
    <pubDate>Fri, 30 Oct 2009 17:06:20 GMT</pubDate>
    <dc:creator>Dadski</dc:creator>
    <dc:date>2009-10-30T17:06:20Z</dc:date>
    <item>
      <title>Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206962#M678436</link>
      <description>&lt;P&gt;Hi All, I am attempting to search a file for all occurances of "PP= 2" the number may differ. What I want to do is search for the "PP=" part and any number assigned to PP to be either multiplied or divded. I would then like to save the entire file and not just the lines with PP=, with the new settings.&lt;BR /&gt;&lt;BR /&gt;I could do this using awk as in:&lt;BR /&gt;awk '/PP=/{print $1" "$2 *2}' filename &amp;gt; file1&lt;BR /&gt;but I need the whole contents of the file and not just the lines containing PP=.&lt;BR /&gt;&lt;BR /&gt;Any Ideas Appreciated.&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;&lt;BR /&gt;Martin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. this thread has been moved from HP-UX &amp;gt; System Administration to HP-UX &amp;gt; languages - HP Forums Moderator&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2012 02:57:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206962#M678436</guid>
      <dc:creator>Dadski</dc:creator>
      <dc:date>2012-11-27T02:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206963#M678437</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;grep -v "PP\=" file &amp;gt; non_PP_lines_file&lt;BR /&gt;grep "PP\=" file &amp;gt; PP_lines_file</description>
      <pubDate>Fri, 30 Oct 2009 15:41:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206963#M678437</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2009-10-30T15:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206964#M678438</link>
      <description>if grep PP= filename &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;then&lt;BR /&gt;    echo "Yep, it PP= is in this file"&lt;BR /&gt;    #(substitute above with any action youwish)&lt;BR /&gt;else&lt;BR /&gt;    echo "Nope, PP= is not in this file"&lt;BR /&gt;    #(ditto)&lt;BR /&gt;fi</description>
      <pubDate>Fri, 30 Oct 2009 15:51:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206964#M678438</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2009-10-30T15:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206965#M678439</link>
      <description>I think he needs something like sed to change&lt;BR /&gt;&lt;BR /&gt;PP=[:digit:]&lt;BR /&gt;&lt;BR /&gt;to &lt;BR /&gt;&lt;BR /&gt;PP=[:digit:] * 2.&lt;BR /&gt;&lt;BR /&gt;while retaining the entirety of the file....I'd guess he needs to keep the order of lines within that file as well, but a better problem description (or sample input with desired output) is needed.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Oct 2009 15:53:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206965#M678439</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2009-10-30T15:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206966#M678440</link>
      <description>Old School,&lt;BR /&gt;&lt;BR /&gt;your right I need to keep the integrity of the file,  I have used sed to amend all the other entries,  the issue I have is I need to either multiply or divide the number assoiciated with PP=  while keeping the rest of the file intact.  I could use awk  but that strips the rest of the file.  and I dont believe you can use mathamatical options in sed?  saying that I am not a sed expert, but I dont think so.  If awk has an option to show the whole file while manipulating the figure then that would be my solution,  but again I dont believe it does.?&lt;BR /&gt;&lt;BR /&gt;Any ideas cause I'm stumped.</description>
      <pubDate>Fri, 30 Oct 2009 17:06:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206966#M678440</guid>
      <dc:creator>Dadski</dc:creator>
      <dc:date>2009-10-30T17:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206967#M678441</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;grep "PP\=" file &amp;gt; PP_lines_file &lt;BR /&gt;&lt;BR /&gt;cat PP_lines_file | sed 's/\=/ /' | awk ${print $1 $2) ) | while read a b&lt;BR /&gt;do&lt;BR /&gt;   TOT=$(($b+$TOT))&lt;BR /&gt;done</description>
      <pubDate>Fri, 30 Oct 2009 17:11:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206967#M678441</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2009-10-30T17:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206968#M678442</link>
      <description>Michael,&lt;BR /&gt;&lt;BR /&gt;the awk part was'nt right,  but did look promising,  I have tried to amend but still not working,  could it the the ksh I am using?</description>
      <pubDate>Fri, 30 Oct 2009 17:23:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206968#M678442</guid>
      <dc:creator>Dadski</dc:creator>
      <dc:date>2009-10-30T17:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206969#M678443</link>
      <description>Throw some bacon treats and paste in what you got so fare</description>
      <pubDate>Fri, 30 Oct 2009 18:20:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206969#M678443</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2009-10-30T18:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206970#M678444</link>
      <description>ok, so you're saying you want to find&lt;BR /&gt;&lt;BR /&gt;PP=2 and replace it w/ PP=4?&lt;BR /&gt;PP=3 and replace it w/ PP=6?&lt;BR /&gt;&lt;BR /&gt;and not something like:&lt;BR /&gt;&lt;BR /&gt;PP=2*2 or PP=3*2 (which is how I read the original post.&lt;BR /&gt;&lt;BR /&gt;awk will by default read and process every line, in your example you tell it to pattern match, then process&lt;BR /&gt;&lt;BR /&gt;a script like the following might be a start&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;if ( $1 ~ /PP=/ )&lt;BR /&gt;   {&lt;BR /&gt;   x=split($1,ppline,"=")&lt;BR /&gt;   print ppline[1] "=" ppline[2]*2&lt;BR /&gt;   }&lt;BR /&gt;else&lt;BR /&gt;   print $0&lt;BR /&gt;}&lt;BR /&gt;~&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Oct 2009 18:50:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206970#M678444</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2009-10-30T18:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206971#M678445</link>
      <description>Interesting. &lt;BR /&gt;&lt;BR /&gt;You refuse to award points even to get the final answer of your script problem.&lt;BR /&gt;&lt;BR /&gt;So I went back and check you out, 1 point assigned for 11 questions asked.&lt;BR /&gt;&lt;BR /&gt;Sigh.  You know this forum is going Paid in Advanced because of people like you?</description>
      <pubDate>Fri, 30 Oct 2009 20:03:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206971#M678445</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2009-10-30T20:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206972#M678446</link>
      <description>&amp;gt;but I need the whole contents of the file and not just the lines containing PP=.&lt;BR /&gt;&lt;BR /&gt;Then just print them:&lt;BR /&gt;awk '&lt;BR /&gt;/PP=/{print $1, $2 *2; next}&lt;BR /&gt;{ print $0 }' filename &amp;gt; file1</description>
      <pubDate>Sat, 31 Oct 2009 06:42:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206972#M678446</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-10-31T06:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206973#M678447</link>
      <description>mlewi000,&lt;BR /&gt;&lt;BR /&gt;Check this out:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code: &lt;BR /&gt;--------------------------------------------&lt;BR /&gt;# awk '{$2=$2*2} /PP=/ {print $0}' pp_file&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;&lt;BR /&gt;# cat pp_file&lt;BR /&gt;  PP= 2 As a quick 0909 A00990&lt;BR /&gt;  PP= 3 As a quick A09093 2342&lt;BR /&gt;  PP= 5 sas a quick 09000! A00&lt;BR /&gt;  PP= 9  sa a aqij 0900  A009&lt;BR /&gt;  PP= 6 as oks fA09000 0090 00&lt;BR /&gt;  SP= 7 sk sa  aik a0000 aa&lt;BR /&gt;  PP= 8.1 Asa sfllks  9990&lt;BR /&gt;  NP= 3  aksfs A0009 aa0009&lt;BR /&gt;#&lt;BR /&gt;# awk '{$2=$2*2} /PP=/ {print $0}' pp_file&lt;BR /&gt;PP= 4 As a quick 0909 A00990&lt;BR /&gt;PP= 6 As a quick A09093 2342&lt;BR /&gt;PP= 10 sas a quick 09000! A00&lt;BR /&gt;PP= 18 sa a aqij 0900 A009&lt;BR /&gt;PP= 12 as oks fA09000 0090 00&lt;BR /&gt;PP= 16.2 Asa sfllks 9990&lt;BR /&gt;# &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*Remember to assign points to the responses all who tried o help you.</description>
      <pubDate>Sat, 31 Oct 2009 08:19:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206973#M678447</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2009-10-31T08:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206974#M678448</link>
      <description>Hi,&lt;BR /&gt;If you satisfied with the answer and your problem got solved then please make a habit to assign points,&lt;BR /&gt;Those people who give there valuable time for your problem they should expect some apparition from you in terms of points.&lt;BR /&gt;&lt;BR /&gt;To know how to assign points please go through the below link&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums13.itrc.hp.com/service/forums/helptips.do?admit=109447627+1256027208667+28353475#33" target="_blank"&gt;http://forums13.itrc.hp.com/service/forums/helptips.do?admit=109447627+1256027208667+28353475#33&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Suraj</description>
      <pubDate>Sun, 01 Nov 2009 22:36:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206974#M678448</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-11-01T22:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206975#M678449</link>
      <description>Old School and Raj D,  apologies for not getting back,  but the weekend took hold.  I did'nt really get what I was looking for but you 2 were  close.  Thanks for everyones time and effort.  I'm going to look into an awk script combined with sed to achieve it. All points assigned</description>
      <pubDate>Mon, 02 Nov 2009 07:25:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206975#M678449</guid>
      <dc:creator>Dadski</dc:creator>
      <dc:date>2009-11-02T07:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206976#M678450</link>
      <description>told a complete lie,  Dennis your response was perfect,  solved it a treat.  Thanks for your time and I have assigned your points.</description>
      <pubDate>Mon, 02 Nov 2009 07:28:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206976#M678450</guid>
      <dc:creator>Dadski</dc:creator>
      <dc:date>2009-11-02T07:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206977#M678451</link>
      <description>Dennis thanks,  thats perfect.</description>
      <pubDate>Mon, 02 Nov 2009 07:28:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206977#M678451</guid>
      <dc:creator>Dadski</dc:creator>
      <dc:date>2009-11-02T07:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206978#M678452</link>
      <description>Michael,  just read your comments, i was'nt aware firstly, a while back when I first joined about the points,  nor did I realise poeple should become really touchy on the system, or that when the weekend arrives you should be waiting at the computer and neglecting time with the family and friends, just to appease some guy, who has no life and personality.  Next time I post I will ensure I neglect my parental responsibilities to appease some aneraked plebs appetite for some points.  Which actually you did'nt post any correct answers.   Denis,  thanks for the correct answer, I gues it was just that awk option I was looking for and not aware of,  please have all 10 points and old schoool and Raj for your time and being close.</description>
      <pubDate>Mon, 02 Nov 2009 07:38:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206978#M678452</guid>
      <dc:creator>Dadski</dc:creator>
      <dc:date>2009-11-02T07:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206979#M678453</link>
      <description>Gee Martin, wouldn't blow your bubble if it became a paid for service instead of the accumulatin of 100's of years of experience all for free?</description>
      <pubDate>Mon, 02 Nov 2009 09:38:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206979#M678453</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2009-11-02T09:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206980#M678454</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Let me take a different approach since its easy to miss some of these links in your profile.  Here is your profile&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/publicProfile.do?forumId=1&amp;amp;userId=CA828944" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/publicProfile.do?forumId=1&amp;amp;userId=CA828944&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;At the very bottom under the last section titled "My Questions" is a hard to miss link call "unassigned points", every thread where you haven't provided 0 to 10 points still gets flagged.  And the only way you can remove these flags is by assigning points.</description>
      <pubDate>Mon, 02 Nov 2009 15:31:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/5206980#M678454</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2009-11-02T15:31:25Z</dc:date>
    </item>
  </channel>
</rss>

