Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.sys.hp.hpux FAQ
Section - 8.45 How can I convert numbers from one base to another?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Houses ]


Top Document: comp.sys.hp.hpux FAQ
Previous Document: 8.44 What commands or scripts exist for gathering and summarizing system information?
Next Document: 8.46 What are the machine ID and serial number used for?
See reader questions & answers on this topic! - Help others by sharing your knowledge

You can use adb(1) to convert decimal to hexadecimal and hexadecimal to
decimal as follows:

To convert decimal 127 to hex:

  $ echo '0d127=X' | adb

You should receive the following output:

  7F

To convert hex 7F to decimal:

  $ echo '0x7f=D' | adb

You should receive the following output:

  127

Alternatively, the 'typeset' and 'set' shell builtins can be used to do
base conversions.  See sh-posix(1) or ksh(1).

User Contributions:

Comment about this article, ask questions, or add new information about this topic:




Top Document: comp.sys.hp.hpux FAQ
Previous Document: 8.44 What commands or scripts exist for gathering and summarizing system information?
Next Document: 8.46 What are the machine ID and serial number used for?

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
hpux.faq@gmail.com





Last Update March 27 2014 @ 02:11 PM