<?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: simple calulation script... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591692#M924967</link>
    <description>Hi Bill,&lt;BR /&gt;&lt;BR /&gt;If you mean convert a number back to x.y.z, then create a file containing:&lt;BR /&gt;&lt;BR /&gt;{ for (i=3;i&amp;gt;=1;i--)&lt;BR /&gt; { val[i]=256*($0/256-int($0/256))&lt;BR /&gt;  $0=int($0/256)&lt;BR /&gt; }&lt;BR /&gt; printf ("%d.%d.%d\n",val[1],val[2],val[3])&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;echo 965892|awk -f/tmp/conv.awk&lt;BR /&gt;14.189.4&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
    <pubDate>Tue, 09 Oct 2001 09:49:55 GMT</pubDate>
    <dc:creator>Robin Wakefield</dc:creator>
    <dc:date>2001-10-09T09:49:55Z</dc:date>
    <item>
      <title>simple calulation script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591689#M924964</link>
      <description>simple for most of you guys at least! ;)&lt;BR /&gt;&lt;BR /&gt;I've got a number that is translated from a numberical string as follows:&lt;BR /&gt;&lt;BR /&gt;numberical string: 1.1.100&lt;BR /&gt;(max 255.255.255)&lt;BR /&gt;256^2 * X + 256^1 * Y + Z&lt;BR /&gt;&lt;BR /&gt;ie 1.1.100 becomes &lt;BR /&gt;65892&lt;BR /&gt;&lt;BR /&gt;How can I go backwards in a script?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bill&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Oct 2001 08:45:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591689#M924964</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-10-09T08:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: simple calulation script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591690#M924965</link>
      <description>How about something like this (needs some cleanups, like prompts, error checking, etc):&lt;BR /&gt;&lt;BR /&gt;----------cut here---------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;read input&lt;BR /&gt;OLDIFS=$IFS&lt;BR /&gt;IFS=.&lt;BR /&gt;set -- $input&lt;BR /&gt;echo $1 $2 $3&lt;BR /&gt;let sum=$1*256+$2&lt;BR /&gt;let sum=sum*256+$3&lt;BR /&gt;echo $sum&lt;BR /&gt;IFS=$OLDIFS&lt;BR /&gt;----------cut here---------&lt;BR /&gt;&lt;BR /&gt;-Santosh</description>
      <pubDate>Tue, 09 Oct 2001 08:59:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591690#M924965</guid>
      <dc:creator>Santosh Nair_1</dc:creator>
      <dc:date>2001-10-09T08:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: simple calulation script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591691#M924966</link>
      <description>&lt;BR /&gt;echo $*                              &lt;BR /&gt;echo $1 | awk -F. ' { print $1*256^2 + $2*256 +$3 }'</description>
      <pubDate>Tue, 09 Oct 2001 09:16:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591691#M924966</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2001-10-09T09:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: simple calulation script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591692#M924967</link>
      <description>Hi Bill,&lt;BR /&gt;&lt;BR /&gt;If you mean convert a number back to x.y.z, then create a file containing:&lt;BR /&gt;&lt;BR /&gt;{ for (i=3;i&amp;gt;=1;i--)&lt;BR /&gt; { val[i]=256*($0/256-int($0/256))&lt;BR /&gt;  $0=int($0/256)&lt;BR /&gt; }&lt;BR /&gt; printf ("%d.%d.%d\n",val[1],val[2],val[3])&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;echo 965892|awk -f/tmp/conv.awk&lt;BR /&gt;14.189.4&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Tue, 09 Oct 2001 09:49:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591692#M924967</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-10-09T09:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: simple calulation script...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591693#M924968</link>
      <description>Many ways to achieve:&lt;BR /&gt;How about this one ?&lt;BR /&gt;&lt;BR /&gt;# V=65892 &lt;BR /&gt;# echo `expr $V / 65536`.`expr $V % 65536 / 256`.`expr $V % 256` &lt;BR /&gt;1.1.100&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;Volker</description>
      <pubDate>Tue, 09 Oct 2001 10:15:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-calulation-script/m-p/2591693#M924968</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2001-10-09T10:15:42Z</dc:date>
    </item>
  </channel>
</rss>

