[LinuxBIOS] Convert hex to dec

Peter Stuge peter at stuge.se
Wed Jul 4 21:32:02 CEST 2007


On Wed, Jul 04, 2007 at 07:47:11PM +0200, Uwe Hermann wrote:
> I use some aliases in my .bashrc which are pretty handy for converting
> HEX or BINARY or DECIMAL:
> 
> alias HEX="ruby -e 'printf(\"0x%X\n\", ARGV[0])'"
> alias DEC="ruby -e 'printf(\"%d\n\", ARGV[0])'"
> alias BIN="ruby -e 'printf(\"%bb\n\", ARGV[0])'"
> 
> (You can replace 'ruby' with 'perl' if you want)

bash has printf too; try printf 0x%X\\n 128


//Peter




More information about the coreboot mailing list