<?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: Hexadecimal conversion in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532709#M638403</link>
    <description>Hi Senjay,&lt;BR /&gt;&lt;BR /&gt;Peggy has given you a c method but there is a way to do it from the shell using the 'bc' binary calculator command. Try This:&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;# ------------------ Hex to Decimal Converter&lt;BR /&gt;&lt;BR /&gt;while [ $# -ge 1 ]&lt;BR /&gt;  do&lt;BR /&gt;    INPUT=$1&lt;BR /&gt;    shift&lt;BR /&gt;    echo "obase=10;ibase=16;${INPUT};quit" | bc&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;# ------------------ Decimal to Hex Converter&lt;BR /&gt;&lt;BR /&gt;while [ $# -ge 1 ]&lt;BR /&gt;  do&lt;BR /&gt;    INPUT=$1&lt;BR /&gt;    shift&lt;BR /&gt;    echo "obase=16;ibase=10;${INPUT};quit" | bc&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Each of these takes any number of input arguments and converts them to the other radix one per line.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;BR /&gt;</description>
    <pubDate>Fri, 25 May 2001 01:41:21 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2001-05-25T01:41:21Z</dc:date>
    <item>
      <title>Hexadecimal conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532706#M638400</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am trying to write a shell script.  Is there a command ( utility ) that I can put that will take a number ( base ten ) and convery it to a hexadecimal number and also the other way around?&lt;BR /&gt;&lt;BR /&gt;Also, is there a way to read a certain directory and copy certain files into another directory?&lt;BR /&gt;&lt;BR /&gt;Thank you for your help,&lt;BR /&gt;Sanjay</description>
      <pubDate>Fri, 25 May 2001 00:10:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532706#M638400</guid>
      <dc:creator>Sanjay Tailor</dc:creator>
      <dc:date>2001-05-25T00:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Hexadecimal conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532707#M638401</link>
      <description>I got this from a friend hope it helps you:&lt;BR /&gt;&lt;BR /&gt;I have a c program I wrote to convert number between octal, hex and decimal. Maybe you'll find it handy. Save it to convert.c than do "cc convert.c -o convert. Than you can run it by just typing convert. I've included an example. Hope this helps.&lt;BR /&gt; &lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;        /* Declare variables */&lt;BR /&gt;        int  number ;&lt;BR /&gt;        char ibase ;&lt;BR /&gt; &lt;BR /&gt;        printf ("Enter base of input number (h)ex, (d)ec, (o)ctal - ") ;&lt;BR /&gt;        scanf ("%c", &amp;amp;ibase) ;&lt;BR /&gt; &lt;BR /&gt;        switch ( ibase )&lt;BR /&gt;        {&lt;BR /&gt;                case 'h' :&lt;BR /&gt;                    printf ("Enter the HEX number - ");&lt;BR /&gt;                    scanf ("%x", &amp;amp;number ) ;&lt;BR /&gt;                    printf ("Decimal = %d\nOctal = %o\n", number, number );&lt;BR /&gt;                    break ;&lt;BR /&gt; &lt;BR /&gt;                case 'd' :&lt;BR /&gt;                    printf ("Enter the DECIMAL number - ");&lt;BR /&gt;                    scanf ("%d", &amp;amp;number ) ;&lt;BR /&gt;                    printf ("Hex = %x\nOctal = %o\n", number, number );&lt;BR /&gt;                    break ;&lt;BR /&gt; &lt;BR /&gt;                case 'o' :&lt;BR /&gt;                    printf ("Enter the OCTAL number - ");&lt;BR /&gt;                    scanf ("%o", &amp;amp;number ) ;&lt;BR /&gt;                    printf ("Decimal = %d\nHex = %x\n", number, number );&lt;BR /&gt;                    break ;&lt;BR /&gt; &lt;BR /&gt;        }&lt;BR /&gt; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Run "convert"&lt;BR /&gt;$ convert&lt;BR /&gt;Enter base of input number (h)ex, (d)ec, (o)ctal - h&lt;BR /&gt;Enter the HEX number - 20&lt;BR /&gt;Decimal = 32&lt;BR /&gt;Octal = 40&lt;BR /&gt;&lt;BR /&gt;As for your second question there are many way to copy files from one directory to another&lt;BR /&gt;You can use find &lt;DIRECTORY&gt; | cpio -pdm &lt;NEW directory=""&gt;  But read up on find in the "man" pages for this... I'm sure others can give you examples as well.&lt;BR /&gt;&lt;BR /&gt;Peggy&lt;/NEW&gt;&lt;/DIRECTORY&gt;</description>
      <pubDate>Fri, 25 May 2001 01:05:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532707#M638401</guid>
      <dc:creator>Peggy Fong</dc:creator>
      <dc:date>2001-05-25T01:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Hexadecimal conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532708#M638402</link>
      <description>For scripting, use bc (it accepts commands as stdin) or xd.&lt;BR /&gt;&lt;BR /&gt;Since you mentioned 'certain' files in 'certain' directories, a standard cp command, perhaps with -p option to retain the original timestamps and permissions.  cd to the source directory and use regular expressions to define 'certain' files.&lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2001 01:36:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532708#M638402</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-05-25T01:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Hexadecimal conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532709#M638403</link>
      <description>Hi Senjay,&lt;BR /&gt;&lt;BR /&gt;Peggy has given you a c method but there is a way to do it from the shell using the 'bc' binary calculator command. Try This:&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;# ------------------ Hex to Decimal Converter&lt;BR /&gt;&lt;BR /&gt;while [ $# -ge 1 ]&lt;BR /&gt;  do&lt;BR /&gt;    INPUT=$1&lt;BR /&gt;    shift&lt;BR /&gt;    echo "obase=10;ibase=16;${INPUT};quit" | bc&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;# ------------------ Decimal to Hex Converter&lt;BR /&gt;&lt;BR /&gt;while [ $# -ge 1 ]&lt;BR /&gt;  do&lt;BR /&gt;    INPUT=$1&lt;BR /&gt;    shift&lt;BR /&gt;    echo "obase=16;ibase=10;${INPUT};quit" | bc&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Each of these takes any number of input arguments and converts them to the other radix one per line.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2001 01:41:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532709#M638403</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-05-25T01:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Hexadecimal conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532710#M638404</link>
      <description>Hi Sanjay:&lt;BR /&gt;&lt;BR /&gt;Another way:&lt;BR /&gt;&lt;BR /&gt;# printf "%#d\n" 0xf&lt;BR /&gt;&lt;BR /&gt;# printf "%#x\n" 15&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 25 May 2001 13:05:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/2532710#M638404</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-05-25T13:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hexadecimal conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/5741883#M638405</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any Tandem SQL or TAL procedures or Cobol snippets to convert a decimal Number to Hexadecimal String.. There are easy steps available in C however we would like to have it in Tandem SQL or TAL or COBOL... Thanks ins advance..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manikanda&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2012 05:53:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/5741883#M638405</guid>
      <dc:creator>Manikanda</dc:creator>
      <dc:date>2012-07-27T05:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Hexadecimal conversion</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/5742605#M638406</link>
      <description>&lt;P&gt;You can also use the shell builtin typeset to convert:&lt;/P&gt;&lt;P&gt;typeset -i16 x=256; echo "$x (256 in hex)"&lt;/P&gt;&lt;P&gt;typeset -i10 y=16#100; echo "$y (0x100 in decimal)"&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2012 15:26:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hexadecimal-conversion/m-p/5742605#M638406</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-07-27T15:26:43Z</dc:date>
    </item>
  </channel>
</rss>

