Is there a tool to convert decimal/octal/hex ?

Anthony Joseph Seward anthony.seward at ieee.org
Tue Jun 1 18:20:39 UTC 2004


On Tue, 2004-06-01 at 12:58 -0500, Randy Kelsoe wrote:
> clemens at dwf.com wrote:
> 
> >I seem to remember that there used to be a tool in Linux to
> >convert between decimal and octal and Hex, but I havent 
> >stumbled over it in my recent search.
> >
> >Anyone know of such a beast?
> >
> In gnome, click on the Fedora Button => Accessories => Calculator. In 
> the calculator, click on  "View" and select 'Scientific Mode'. From a 
> command line, type 'gcalctool'.
> 
> 

or a better command line answer is bc:

Number of seconds since 00:00:00 1970-01-01 UTC in
	1) octal: echo "obase=8;$(date +%s)" | bc -l
	2) decimal: echo "obase=10;$(date +%s)" | bc -l
	3) hex: echo "obase=16;$(date +%s)" | bc -l
	
-- 
Anthony Joseph Seward <anthony.seward at ieee.org>





More information about the users mailing list