simpliest way to calculate octal?

Miguel Mendez flynn at energyhq.es.eu.org
Sun Nov 9 22:55:22 PST 2003


On Mon, 10 Nov 2003 14:35:35 +0800
"Zhang Weiwu" <weiwuzhang at hotmail.com> wrote:

Hi,

> Today I found I cannot calculate what is the octal form of 0xa04e.
> 
> First I thought xcalc should do the work, but it seems only deal with 
> decimal.
> 
> I have perl, tcsh, python interprater. It is likely that they are all 
> capable of this kind, but what are the commands for them? What's the most 
> convenient way?

How about: echo 0xa04e | awk '{printf "%o\n",$1}'

Cheers,
-- 
	Miguel Mendez <flynn at energyhq.es.eu.org>
	http://www.energyhq.es.eu.org


More information about the freebsd-questions mailing list