<?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: How can I reduce count value in shell scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981052#M547372</link>
    <description>There are several ways as mentioned above as well as&lt;BR /&gt;&lt;BR /&gt;echo $MYVAR - 1 | bc&lt;BR /&gt;&lt;BR /&gt;If you want to store in a variable&lt;BR /&gt;result=$(echo $MYVAR - 1 | bc)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ninad</description>
    <pubDate>Fri, 26 May 2006 07:02:03 GMT</pubDate>
    <dc:creator>Ninad_1</dc:creator>
    <dc:date>2006-05-26T07:02:03Z</dc:date>
    <item>
      <title>How can I reduce count value in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981048#M547368</link>
      <description>I have set variable in script in between want to reduce the count by one.&lt;BR /&gt;&lt;BR /&gt;Please advice.</description>
      <pubDate>Fri, 26 May 2006 06:15:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981048#M547368</guid>
      <dc:creator>Saraswathy_1</dc:creator>
      <dc:date>2006-05-26T06:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I reduce count value in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981049#M547369</link>
      <description>Hi,&lt;BR /&gt;man expr&lt;BR /&gt;&lt;BR /&gt;a=10&lt;BR /&gt;a=`expr $a - 1`&lt;BR /&gt;echo $a&lt;BR /&gt;9&lt;BR /&gt;</description>
      <pubDate>Fri, 26 May 2006 06:21:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981049#M547369</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-05-26T06:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I reduce count value in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981050#M547370</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Using the shell's arithmetic:&lt;BR /&gt;&lt;BR /&gt;# X=10;X=$((X - 1));echo ${X}&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 26 May 2006 06:26:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981050#M547370</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-05-26T06:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I reduce count value in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981051#M547371</link>
      <description>Another way which is easier to read is:&lt;BR /&gt; &lt;BR /&gt;let MYVAR=$MYVAR-1&lt;BR /&gt; &lt;BR /&gt;You can use normal math symbols in the arithmetic let statement:&lt;BR /&gt; &lt;BR /&gt;let MYVAR=$MYVAR*3&lt;BR /&gt;let MYVAR=$VAR2-$VAR3+1&lt;BR /&gt;</description>
      <pubDate>Fri, 26 May 2006 06:27:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981051#M547371</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-05-26T06:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I reduce count value in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981052#M547372</link>
      <description>There are several ways as mentioned above as well as&lt;BR /&gt;&lt;BR /&gt;echo $MYVAR - 1 | bc&lt;BR /&gt;&lt;BR /&gt;If you want to store in a variable&lt;BR /&gt;result=$(echo $MYVAR - 1 | bc)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ninad</description>
      <pubDate>Fri, 26 May 2006 07:02:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981052#M547372</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2006-05-26T07:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I reduce count value in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981053#M547373</link>
      <description>In the superior Scripting language of Perl :) you can use the same pre-fix and post-fix operators as C/C++.&lt;BR /&gt;&lt;BR /&gt;a++; increase by 1&lt;BR /&gt;a--; decrease by 1</description>
      <pubDate>Fri, 26 May 2006 07:02:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981053#M547373</guid>
      <dc:creator>Glen R. Bartlett</dc:creator>
      <dc:date>2006-05-26T07:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I reduce count value in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981054#M547374</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm missing this format:&lt;BR /&gt;&lt;BR /&gt;typeset -i var=12&lt;BR /&gt;((var-=1))&lt;BR /&gt;&lt;BR /&gt;print $var says 11&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 26 May 2006 07:10:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981054#M547374</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-05-26T07:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I reduce count value in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981055#M547375</link>
      <description>csh can also use the C type operators&lt;BR /&gt;&lt;BR /&gt;--------------&lt;BR /&gt;#!/usr/bin/csh&lt;BR /&gt;&lt;BR /&gt;@ a = 4&lt;BR /&gt;@ a--&lt;BR /&gt;echo "$a"&lt;BR /&gt;@ a += 2&lt;BR /&gt;echo "$a"&lt;BR /&gt;--------------&lt;BR /&gt;output:&lt;BR /&gt;3&lt;BR /&gt;5</description>
      <pubDate>Fri, 26 May 2006 07:28:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981055#M547375</guid>
      <dc:creator>Glen R. Bartlett</dc:creator>
      <dc:date>2006-05-26T07:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can I reduce count value in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981056#M547376</link>
      <description>You can say-&lt;BR /&gt; &lt;BR /&gt;(( MYVAR=MYVAR - 1 ))&lt;BR /&gt;or equivalent&lt;BR /&gt;let "MYVAR=MYVAR - 1"&lt;BR /&gt; &lt;BR /&gt;Note that you don't need $ in front of variables names since the shell is doing the arithmetic calculations.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Fri, 26 May 2006 09:35:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981056#M547376</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2006-05-26T09:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I reduce count value in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981057#M547377</link>
      <description>thanks</description>
      <pubDate>Fri, 26 May 2006 10:25:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-can-i-reduce-count-value-in-shell-scripting/m-p/4981057#M547377</guid>
      <dc:creator>Saraswathy_1</dc:creator>
      <dc:date>2006-05-26T10:25:04Z</dc:date>
    </item>
  </channel>
</rss>

