<?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: Shell program problem! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797458#M81222</link>
    <description>Hi&lt;BR /&gt;awk ' { $1 ~ /^isduser/ { if ($3 &amp;gt;= 1000) ; print $1 $3 }}' &lt;FILENAME&gt;&lt;BR /&gt;&lt;/FILENAME&gt;</description>
    <pubDate>Fri, 30 Aug 2002 12:12:41 GMT</pubDate>
    <dc:creator>Leif Halvarsson_2</dc:creator>
    <dc:date>2002-08-30T12:12:41Z</dc:date>
    <item>
      <title>Shell program problem!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797455#M81219</link>
      <description>I have a text file cosalary , and it's format like this:&lt;BR /&gt;username    sn salary&lt;BR /&gt;=========   == ======&lt;BR /&gt;acduser0001 1  1355 &lt;BR /&gt;acduser0002 2  1570&lt;BR /&gt;...&lt;BR /&gt;isduser0001 1  1669&lt;BR /&gt;isduser0002 2  1398&lt;BR /&gt;...&lt;BR /&gt;psduser0001 1  1688&lt;BR /&gt;psduser0002 2  1568&lt;BR /&gt;...&lt;BR /&gt;I want to make that all users whose username begin with "isduser", its salary increase 1000. &lt;BR /&gt;How to do?&lt;BR /&gt;Thanks a lot!</description>
      <pubDate>Fri, 30 Aug 2002 11:58:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797455#M81219</guid>
      <dc:creator>Fragon</dc:creator>
      <dc:date>2002-08-30T11:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Shell program problem!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797456#M81220</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;here is a quick and dirty awk hack, use with care:awk 'match($1,"^isduser") { printf "%s %d %d\n",$1,$2,$3+1000;a=1}&lt;BR /&gt;a==0 {print $0}&lt;BR /&gt;{a=0}' &lt;ORIGFILE&gt; &amp;gt; &lt;NEWFILE&gt;&lt;BR /&gt;&lt;BR /&gt;You my move the newfile over the origfile&lt;BR /&gt;mv &lt;ORIGFILE&gt; &lt;ORIGFILE&gt;.bak&lt;BR /&gt;mv &lt;NEWFILE&gt; &lt;ORIGFILE&gt;&lt;BR /&gt;&lt;BR /&gt;Heiner&lt;BR /&gt;&lt;BR /&gt;&lt;/ORIGFILE&gt;&lt;/NEWFILE&gt;&lt;/ORIGFILE&gt;&lt;/ORIGFILE&gt;&lt;/NEWFILE&gt;&lt;/ORIGFILE&gt;</description>
      <pubDate>Fri, 30 Aug 2002 12:09:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797456#M81220</guid>
      <dc:creator>Heiner E. Lennackers</dc:creator>
      <dc:date>2002-08-30T12:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Shell program problem!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797457#M81221</link>
      <description>awk '&lt;BR /&gt;{ &lt;BR /&gt;if(substr($1,1,7)=="isduser")&lt;BR /&gt;  { salary=$3 + 1000;&lt;BR /&gt;    print $1,$2,salary;&lt;BR /&gt;  } else print $0;&lt;BR /&gt;}' yourfile &amp;gt; yournewfile&lt;BR /&gt;&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Fri, 30 Aug 2002 12:10:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797457#M81221</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2002-08-30T12:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Shell program problem!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797458#M81222</link>
      <description>Hi&lt;BR /&gt;awk ' { $1 ~ /^isduser/ { if ($3 &amp;gt;= 1000) ; print $1 $3 }}' &lt;FILENAME&gt;&lt;BR /&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Fri, 30 Aug 2002 12:12:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797458#M81222</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-08-30T12:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Shell program problem!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797459#M81223</link>
      <description>cat filename | awk '{salary=$3; if ( /^isduser/ ) {salary = salary * 1.10}; printf("%s %s %s\n",$1,$2,salary);}'&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Fri, 30 Aug 2002 12:14:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797459#M81223</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-30T12:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Shell program problem!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797460#M81224</link>
      <description>l1:/u/usr/merijn 107 &amp;gt; cat sal_file&lt;BR /&gt;username sn salary&lt;BR /&gt;========= == ======&lt;BR /&gt;acduser0001 1 1355&lt;BR /&gt;acduser0002 2 1570&lt;BR /&gt;...&lt;BR /&gt;isduser0001 1 1669&lt;BR /&gt;isduser0002 2 1398&lt;BR /&gt;...&lt;BR /&gt;psduser0001 1 1688&lt;BR /&gt;psduser0002 2 1568&lt;BR /&gt;l1:/u/usr/merijn 108 &amp;gt; perl -pi -e'/^isduser/&amp;amp;&amp;amp;s/\b(\d+)$/$1+1000/e' sal_file&lt;BR /&gt;l1:/u/usr/merijn 109 &amp;gt; cat sal_file&lt;BR /&gt;username sn salary&lt;BR /&gt;========= == ======&lt;BR /&gt;acduser0001 1 1355&lt;BR /&gt;acduser0002 2 1570&lt;BR /&gt;...&lt;BR /&gt;isduser0001 1 2669&lt;BR /&gt;isduser0002 2 2398&lt;BR /&gt;...&lt;BR /&gt;psduser0001 1 1688&lt;BR /&gt;psduser0002 2 1568&lt;BR /&gt;l1:/u/usr/merijn 110 &amp;gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Aug 2002 12:14:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797460#M81224</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-08-30T12:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Shell program problem!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797461#M81225</link>
      <description>&lt;BR /&gt;change my {salary=salary*1.10} to {salary=salary+1000}&lt;BR /&gt;&lt;BR /&gt;as in&lt;BR /&gt;&lt;BR /&gt;cat dah4 | awk '{salary=$3; if ( /^isduser/ ) {salary=salary + 1000}; printf("%s %s %s\n", $1, $2, salary);}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Fri, 30 Aug 2002 12:23:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797461#M81225</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-30T12:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Shell program problem!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797462#M81226</link>
      <description>&lt;BR /&gt;Sorry&lt;BR /&gt;&lt;BR /&gt;I misunderstod you, this should work better.&lt;BR /&gt;awk  ' $1 ~ /^isduser/  { if ($3 &amp;gt;= 1000) ; print $1" "$2" " $3+1000  } &lt;BR /&gt;$1 !~ /^isduser/ { print $0 } ' &lt;FILENAME&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Fri, 30 Aug 2002 12:38:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-program-problem/m-p/2797462#M81226</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-08-30T12:38:27Z</dc:date>
    </item>
  </channel>
</rss>

