<?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: Convert  Decimal to Binary &amp;amp; Hex, and vice versa in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499705#M883013</link>
    <description>I cannot resist to reply:&lt;BR /&gt;&lt;BR /&gt;Use the "printf" command... Yes, it exist.&lt;BR /&gt;&lt;BR /&gt;$ printf "dec -&amp;gt; hex %d = %x\n" 32 32&lt;BR /&gt;&lt;BR /&gt;$ printf "hex -&amp;gt; dec %x = %d\n" 0x20 0x20&lt;BR /&gt;</description>
    <pubDate>Thu, 01 Mar 2001 09:36:09 GMT</pubDate>
    <dc:creator>Jdamian</dc:creator>
    <dc:date>2001-03-01T09:36:09Z</dc:date>
    <item>
      <title>Convert  Decimal to Binary &amp; Hex, and vice versa</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499702#M883010</link>
      <description>Anybody knows of any commands / utilities / freewares for HP-UX 10.20 or 11.0 which can -&lt;BR /&gt;a)Convert from Decimal to Binary, &amp;amp; vice versa.&lt;BR /&gt;b)Convert from Decimal to Hexadecimal, &amp;amp; vice versa.&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Mar 2001 08:02:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499702#M883010</guid>
      <dc:creator>Kong Kian Chay</dc:creator>
      <dc:date>2001-03-01T08:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert  Decimal to Binary &amp; Hex, and vice versa</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499703#M883011</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;dtcalc can convert them. Or you can write a short C program using scanf and printf.&lt;BR /&gt;&lt;BR /&gt;Bye, Thomas</description>
      <pubDate>Thu, 01 Mar 2001 08:08:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499703#M883011</guid>
      <dc:creator>Thomas Kollig</dc:creator>
      <dc:date>2001-03-01T08:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert  Decimal to Binary &amp; Hex, and vice versa</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499704#M883012</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you could use the bc command within a script ie:&lt;BR /&gt;-------------------------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# decimal to binary&lt;BR /&gt;dec2bin()&lt;BR /&gt;{&lt;BR /&gt;{&lt;BR /&gt;echo "obase=2"&lt;BR /&gt;echo "$1"&lt;BR /&gt;echo "quit"&lt;BR /&gt;}|bc&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;dec=255 # example&lt;BR /&gt;bin=$(dec2bin $dec)&lt;BR /&gt;echo $bin&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# binary to decimal&lt;BR /&gt;bin2dec()&lt;BR /&gt;{&lt;BR /&gt;{&lt;BR /&gt;echo "ibase=2"&lt;BR /&gt;echo "$1"&lt;BR /&gt;echo "quit"&lt;BR /&gt;}|bc&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;bin=010101 # example&lt;BR /&gt;dec=$(bin2dec $bin)&lt;BR /&gt;echo $dec&lt;BR /&gt;-----------------------------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# decimal to hex&lt;BR /&gt;dec2hex()&lt;BR /&gt;{&lt;BR /&gt;{&lt;BR /&gt;echo "obase=16"&lt;BR /&gt;echo "$1"&lt;BR /&gt;echo "quit"&lt;BR /&gt;}|bc&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;dec=255 # example&lt;BR /&gt;hex=$(dec2hex $dec)&lt;BR /&gt;echo $hex&lt;BR /&gt;--------------------------------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# hex to decimal&lt;BR /&gt;hex2dec()&lt;BR /&gt;{&lt;BR /&gt;{&lt;BR /&gt;echo "ibase=16"&lt;BR /&gt;echo "$1"&lt;BR /&gt;echo "quit"&lt;BR /&gt;}|bc&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;hex=0A # example&lt;BR /&gt;dec=$(hex2dec $hex)&lt;BR /&gt;echo $dec&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 01 Mar 2001 08:41:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499704#M883012</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-03-01T08:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert  Decimal to Binary &amp; Hex, and vice versa</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499705#M883013</link>
      <description>I cannot resist to reply:&lt;BR /&gt;&lt;BR /&gt;Use the "printf" command... Yes, it exist.&lt;BR /&gt;&lt;BR /&gt;$ printf "dec -&amp;gt; hex %d = %x\n" 32 32&lt;BR /&gt;&lt;BR /&gt;$ printf "hex -&amp;gt; dec %x = %d\n" 0x20 0x20&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Mar 2001 09:36:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499705#M883013</guid>
      <dc:creator>Jdamian</dc:creator>
      <dc:date>2001-03-01T09:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert  Decimal to Binary &amp; Hex, and vice versa</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499706#M883014</link>
      <description>Thanks for all the prompt &amp;amp; detailed replies. I really learned a lot from this forum &amp;amp; am very glad that I'm a member.</description>
      <pubDate>Mon, 05 Mar 2001 07:06:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-decimal-to-binary-amp-hex-and-vice-versa/m-p/2499706#M883014</guid>
      <dc:creator>Kong Kian Chay</dc:creator>
      <dc:date>2001-03-05T07:06:39Z</dc:date>
    </item>
  </channel>
</rss>

