simpliest way to calculate octal?

Francesco Casadei fcasadei at
Mon Nov 10 03:18:26 PST 2003

On Mon, Nov 10, 2003 at 02:35:35PM +0800, Zhang Weiwu wrote:
> Hello. Pretty newbie question again:)
> 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?
> _________________________________________________________________
> ???????? MSN Explorer:  
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"
> end of the original message

You can use 'bc' for this and other conversions:

$ echo 'ibase = 16; obase = 8; A04E' | bc

ibase and obase are the input and output base respectively. Note that you
must use capital letters for exadecimal numbers, lower case letters are
variable names.
See bc(1) manual page for more information.

    Francesco Casadei
You can download my public key from
or retrieve it from a keyserver (,, ...)

Key fingerprint is: 1671 9A23 ACB4 520A E7EE  00B0 7EC3 375F 164E B17B

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list