<?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: ksh: max value of integer? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809870#M720871</link>
    <description>You probably want a copy of bdfmegs, a script that shows disks in megs (much more practical with today's disks). Get a copy at:&lt;BR /&gt;&lt;BR /&gt;ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/coolscripts/&lt;BR /&gt;&lt;BR /&gt;Netscape and Opera work fine with an ftp URL but newer Internet Exploders will hang if the folder view is enabled (which is the dumb default). Turn it off in the Tools-&amp;gt;Internet-&amp;gt;Advanced menu.</description>
    <pubDate>Mon, 07 Oct 2002 01:09:34 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2002-10-07T01:09:34Z</dc:date>
    <item>
      <title>ksh: max value of integer?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809865#M720866</link>
      <description>Hi,&lt;BR /&gt;When files can be larger than 2Gb can the size still be assigned to a ksh integer?  What is the maximum number a ksh variable can hold?&lt;BR /&gt;&lt;BR /&gt;On some of the servers the gzip has not be ugraded to handle files larger than 2Gb so I want part of a script to do an error check and compare the size of a file to 2,147,283,648.  I have been looking around a lot but have not come across any information about using larger numbers in shells.  Do the companies which have very large files have to use another language such as perl or tcl to be able to user numbers larger than 2,147,283,648 or 4,294,967,296 (4 Gb)?</description>
      <pubDate>Thu, 19 Sep 2002 15:49:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809865#M720866</guid>
      <dc:creator>L Tattrie</dc:creator>
      <dc:date>2002-09-19T15:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: ksh: max value of integer?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809866#M720867</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Posix shell is 2^32-1 (2147283648).&lt;BR /&gt;&lt;BR /&gt;You could use the output of du -k &lt;FILE&gt; which is in kilobytes to do your test in the shell rather than the actual size in bytes.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;/FILE&gt;</description>
      <pubDate>Thu, 19 Sep 2002 15:59:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809866#M720867</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-09-19T15:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: ksh: max value of integer?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809867#M720868</link>
      <description>Much thanks John.  That is exactly what I asked plus what I needed to know.&lt;BR /&gt;- Lawrence</description>
      <pubDate>Thu, 19 Sep 2002 16:04:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809867#M720868</guid>
      <dc:creator>L Tattrie</dc:creator>
      <dc:date>2002-09-19T16:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: ksh: max value of integer?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809868#M720869</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You can use 'bc' in a shell to do arithmetic that involves numbers greater than 2^32-1 and/or to do real (not integer) arithmetic:&lt;BR /&gt;&lt;BR /&gt;# X=1;Y=8;echo "scale=3\n $X/$Y"|bc &lt;BR /&gt;&lt;BR /&gt;# echo "(2^33-1)/3"|bc&lt;BR /&gt;&lt;BR /&gt;The output can be examined as a string and passed (again) to 'bc' for further calculation.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 19 Sep 2002 16:12:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809868#M720869</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-09-19T16:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: ksh: max value of integer?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809869#M720870</link>
      <description>Thanks for the quick accurate info.  This tiny script shows the problem of large integers when a file using more than 2gb is passed to the script.&lt;BR /&gt;#!/usr/bin/sh                       &lt;BR /&gt;FILE=$1                             &lt;BR /&gt;print "Use du -k to get size"       &lt;BR /&gt;TWO_GB=2096956                      &lt;BR /&gt;KB=`du -k $FILE | awk '{print $1}'` &lt;BR /&gt;print "KB is $KB TWO_GB is $TWO_GB" &lt;BR /&gt;if [[ $KB -gt $TWO_GB ]]            &lt;BR /&gt;  then                              &lt;BR /&gt;    print "File is more than 2 gb"  &lt;BR /&gt;  else                              &lt;BR /&gt;    print "File is less than 2 gb"  &lt;BR /&gt;fi                                  &lt;BR /&gt;print "Use actual file size "       &lt;BR /&gt;FSIZE=`ls -l $FILE | awk '{print $5}&lt;BR /&gt;print "FSIZE is $FSIZE "            &lt;BR /&gt;if [[ $FSIZE -gt 2147283647 ]]      &lt;BR /&gt;  then                              &lt;BR /&gt;    print "File is more than 2 gb"  &lt;BR /&gt;  else                              &lt;BR /&gt;    print "File is less than 2 gb"  &lt;BR /&gt;fi                                  &lt;BR /&gt;This gave results of&lt;BR /&gt;Use du -k to get size                 &lt;BR /&gt;KB is 2635792 TWO_GB is 2096956       &lt;BR /&gt;File is more than 2 gb                &lt;BR /&gt;Use actual file size                  &lt;BR /&gt;FSIZE is 2699042816                   &lt;BR /&gt;File is less than 2 gb                &lt;BR /&gt;&lt;BR /&gt;The use of bc is interesting but I could not set a return code for true or false.&lt;BR /&gt;As disk drives get larger so will the use of arbitrary length integers.</description>
      <pubDate>Thu, 19 Sep 2002 22:20:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809869#M720870</guid>
      <dc:creator>L Tattrie</dc:creator>
      <dc:date>2002-09-19T22:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: ksh: max value of integer?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809870#M720871</link>
      <description>You probably want a copy of bdfmegs, a script that shows disks in megs (much more practical with today's disks). Get a copy at:&lt;BR /&gt;&lt;BR /&gt;ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/coolscripts/&lt;BR /&gt;&lt;BR /&gt;Netscape and Opera work fine with an ftp URL but newer Internet Exploders will hang if the folder view is enabled (which is the dumb default). Turn it off in the Tools-&amp;gt;Internet-&amp;gt;Advanced menu.</description>
      <pubDate>Mon, 07 Oct 2002 01:09:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-max-value-of-integer/m-p/2809870#M720871</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2002-10-07T01:09:34Z</dc:date>
    </item>
  </channel>
</rss>

