<?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 Convert Hex to Binary in HP UX in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753123#M656720</link>
    <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;In bash I can do:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ echo -e -n "\xab\xcd\xef"|od -A n -tx1&lt;BR /&gt; ab cd ef&lt;BR /&gt;$ printf "%b"  "\xab\xcd\xef"|od -A n -tx1&lt;BR /&gt; ab cd ef&lt;BR /&gt;&lt;BR /&gt;but ksh only admits "\0", not "\x". How can I do this in ksh?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Jose Luis</description>
    <pubDate>Tue, 15 Feb 2011 10:38:05 GMT</pubDate>
    <dc:creator>jose_luis_fdez_diaz</dc:creator>
    <dc:date>2011-02-15T10:38:05Z</dc:date>
    <item>
      <title>Convert Hex to Binary in HP UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753123#M656720</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;In bash I can do:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ echo -e -n "\xab\xcd\xef"|od -A n -tx1&lt;BR /&gt; ab cd ef&lt;BR /&gt;$ printf "%b"  "\xab\xcd\xef"|od -A n -tx1&lt;BR /&gt; ab cd ef&lt;BR /&gt;&lt;BR /&gt;but ksh only admits "\0", not "\x". How can I do this in ksh?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Jose Luis</description>
      <pubDate>Tue, 15 Feb 2011 10:38:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753123#M656720</guid>
      <dc:creator>jose_luis_fdez_diaz</dc:creator>
      <dc:date>2011-02-15T10:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Hex to Binary in HP UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753124#M656721</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try with binary calculator command:&lt;BR /&gt;#echo "ibase=16;obase=2;3E8"|bc&lt;BR /&gt;&lt;BR /&gt;Check binary calculator command syntax:&lt;BR /&gt;#man bc&lt;BR /&gt;&lt;BR /&gt;Rgds.</description>
      <pubDate>Tue, 15 Feb 2011 12:03:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753124#M656721</guid>
      <dc:creator>Jose Mosquera</dc:creator>
      <dc:date>2011-02-15T12:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Hex to Binary in HP UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753125#M656722</link>
      <description>Wrote this quickie awhile back....&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;#set -x&lt;BR /&gt;# Written: Rita Workman&lt;BR /&gt;#&lt;BR /&gt;echo "Convert DECIMAL / HEX utility:"&lt;BR /&gt;echo ""&lt;BR /&gt;echo " Enter a 1 to convert dec-to-hex "&lt;BR /&gt;echo " Enter a 2 to convert hex-to-dec"&lt;BR /&gt;echo " Enter an E to exit"&lt;BR /&gt;&lt;BR /&gt;read e_code&lt;BR /&gt;case "$e_code" in&lt;BR /&gt;        *Ee|Qq|quit|exit|bye) echo Quitting! See you Later; exit ;;&lt;BR /&gt;        2)&lt;BR /&gt;        echo "Converting hexidecimal to decimal...:"&lt;BR /&gt;        echo "&amp;gt;&amp;gt;&amp;gt; Enter decimal value: "&lt;BR /&gt;        read HEX&lt;BR /&gt;        echo $HEX&lt;BR /&gt;        DECV=`echo "0X$HEX=D" | /usr/bin/adb -o`&lt;BR /&gt;        echo "DECIMAL value is:   $DECV"&lt;BR /&gt;        echo ""&lt;BR /&gt;;;&lt;BR /&gt;        1)&lt;BR /&gt;        echo "Converting decimal to hexidecimal.."&lt;BR /&gt;        echo "&amp;gt;&amp;gt;&amp;gt; Enter decimal value: "&lt;BR /&gt;        read DECV_in&lt;BR /&gt;        echo $DECV_in&lt;BR /&gt;        DECV=`echo "0D$DECV_in=X" | /usr/bin/adb -o`&lt;BR /&gt;        echo "HEX value is:   $DECV"&lt;BR /&gt;        echo ""&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;Rgrds,&lt;BR /&gt;Rita&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Feb 2011 13:18:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753125#M656722</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2011-02-15T13:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Hex to Binary in HP UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753126#M656723</link>
      <description>Hi Jose:&lt;BR /&gt;&lt;BR /&gt;The bash shell differs slightly from either the 'ksh' or POSIX shell of HP-UX ('/usr/bin/sh').&lt;BR /&gt;&lt;BR /&gt;That said, if you want to convert hexadecimal to binary you could do:&lt;BR /&gt;&lt;BR /&gt;# perl -e 'printf qq(%#b\n), hex(shift)' &lt;BR /&gt;&lt;BR /&gt;Pass  the value you want converted, like:&lt;BR /&gt;&lt;BR /&gt;# perl -e 'printf qq(%#b\n), hex(shift)' abcdef&lt;BR /&gt;0b101010111100110111101111&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Feb 2011 14:12:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753126#M656723</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-02-15T14:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Hex to Binary in HP UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753127#M656724</link>
      <description>&lt;BR /&gt;I have found this solutions on Internet:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;echo -n "abcdef"|perl -e 'print pack "H*", $_ for &amp;lt;&amp;gt;; '|od -A n -tx1&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jose Luis</description>
      <pubDate>Tue, 15 Feb 2011 14:46:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753127#M656724</guid>
      <dc:creator>jose_luis_fdez_diaz</dc:creator>
      <dc:date>2011-02-15T14:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Hex to Binary in HP UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753128#M656725</link>
      <description>if you have xwindows &lt;BR /&gt;&lt;BR /&gt;bring up xhpcalc&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Feb 2011 23:38:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753128#M656725</guid>
      <dc:creator>Emil Velez</dc:creator>
      <dc:date>2011-02-15T23:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Hex to Binary in HP UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753129#M656726</link>
      <description>You can use typeset to do the conversion in a real shell:&lt;BR /&gt;$ typeset -i2 x=16#deadbeef; echo $x&lt;BR /&gt;2#11011110101011011011111011101111&lt;BR /&gt;&lt;BR /&gt;ksh allows larger, unfortunately not unsigned:&lt;BR /&gt;$ typeset -i2 x=16#deadbeeffeedface; echo $x&lt;BR /&gt;-2#10000101010010010000010001000000000001000100100000010100110010</description>
      <pubDate>Thu, 17 Feb 2011 08:37:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753129#M656726</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-02-17T08:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Hex to Binary in HP UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753130#M656727</link>
      <description>Hi (again) Jose:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I have found this solutions on Internet:&lt;BR /&gt;&amp;gt; echo -n "abcdef"|perl -e 'print pack "H*", $_ for &amp;lt;&amp;gt;; '|od -A n -tx1&lt;BR /&gt;&lt;BR /&gt;Your question was misleading.  I would have framed it as how to convert a string into hexadecimal nybbles (4-bit groups of hexadecimal characters).&lt;BR /&gt;&lt;BR /&gt;That said, this is shorter and more generalized:&lt;BR /&gt;&lt;BR /&gt;# echo "abcdef"|perl -ne 'chomp;print pack "H*",$_'|od -A n -tx1&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 17 Feb 2011 13:36:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/convert-hex-to-binary-in-hp-ux/m-p/4753130#M656727</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-02-17T13:36:49Z</dc:date>
    </item>
  </channel>
</rss>

