<?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: Setting a value with AWK in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155859#M684062</link>
    <description>Thanks guys.. &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 10 Feb 2009 14:43:30 GMT</pubDate>
    <dc:creator>rmueller58</dc:creator>
    <dc:date>2009-02-10T14:43:30Z</dc:date>
    <item>
      <title>Setting a value with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155854#M684057</link>
      <description>I am wanting to define a variable in a shell script value using AWK&lt;BR /&gt;&lt;BR /&gt;If I have a value greater then 6 then define it as the next value, so 6=7, 7=8, 8=9, 9=10 upto a max of 20, and if the value is NULL or empty define it as 6. &lt;BR /&gt;&lt;BR /&gt;CURDOCID=`awk -F"|" '{print $1}' /tmp/jacunload.txt`&lt;BR /&gt;NEWDOCID=${CURDOCID}+1&lt;BR /&gt;echo ${NEWDOCID}&lt;BR /&gt;&lt;BR /&gt;CURDOCID Is integer or is NULL. &lt;BR /&gt;&lt;BR /&gt;If it is null I want to assign a value of 6 to NEWDOCID if is valued I want to increment it but 1. &lt;BR /&gt;&lt;BR /&gt;any assistance appreciated deeply</description>
      <pubDate>Mon, 09 Feb 2009 22:07:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155854#M684057</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2009-02-09T22:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a value with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155855#M684058</link>
      <description>&amp;gt;NEWDOCID=`expr "${CURDOCID}" + 1`&lt;BR /&gt;&lt;BR /&gt;You can also use the shell directly:&lt;BR /&gt;(( NEWDOCID = CURDOCID + 1 ))&lt;BR /&gt;NEWDOCID=$(( CURDOCID + 1 ))</description>
      <pubDate>Mon, 09 Feb 2009 23:07:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155855#M684058</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-02-09T23:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a value with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155856#M684059</link>
      <description>Try this in ksh:&lt;BR /&gt;&lt;BR /&gt;echo "${CURDOCID:-6}"&lt;BR /&gt;&lt;BR /&gt;will default to 6 if not set to anything else.</description>
      <pubDate>Mon, 09 Feb 2009 23:15:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155856#M684059</guid>
      <dc:creator>Mark McDonald_2</dc:creator>
      <dc:date>2009-02-09T23:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a value with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155857#M684060</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Why not let 'awk' do everything!?!&lt;BR /&gt;&lt;BR /&gt;# awk '{if (NF&amp;lt;=1) {print "6";next};if ($2&amp;gt;5 &amp;amp;&amp;amp; $2&amp;lt;21) {print $2+1} else {print $2}}' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 09 Feb 2009 23:18:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155857#M684060</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-09T23:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a value with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155858#M684061</link>
      <description>James, &lt;BR /&gt;&lt;BR /&gt;I am reinventing a major script that has been a mess from the outset combining the function of about 6 scripts into a much more streamline solution. &lt;BR /&gt;&lt;BR /&gt;Awk has been my friend for some time but my scripting knowledge or lack their of limited how much I used it. It has become a very important tool. &lt;BR /&gt;&lt;BR /&gt;Thanks for all that replied. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Feb 2009 14:06:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155858#M684061</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2009-02-10T14:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Setting a value with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155859#M684062</link>
      <description>Thanks guys.. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Feb 2009 14:43:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-a-value-with-awk/m-p/5155859#M684062</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2009-02-10T14:43:30Z</dc:date>
    </item>
  </channel>
</rss>

