From owner-freebsd-questions@FreeBSD.ORG Mon Nov 10 03:18:26 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 61F6D16A4CE for ; Mon, 10 Nov 2003 03:18:26 -0800 (PST) Received: from mail-3.tiscali.it (mail-3.tiscali.it [195.130.225.149]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58F0B43FDD for ; Mon, 10 Nov 2003 03:18:25 -0800 (PST) (envelope-from fcasadei@inwind.it) Received: from goku.kasby (82.84.234.181) by mail-3.tiscali.it (6.7.019) id 3FAB9069001BE744 for freebsd-questions@freebsd.org; Mon, 10 Nov 2003 12:18:24 +0100 Received: (qmail 1637 invoked by uid 1000); 10 Nov 2003 11:18:08 -0000 Date: Mon, 10 Nov 2003 12:18:08 +0100 From: Francesco Casadei To: Zhang Weiwu Message-ID: <20031110111808.GA1604@goku.kasby> Mail-Followup-To: Zhang Weiwu , freebsd-questions@freebsd.org References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.9-STABLE i386 cc: freebsd-questions@freebsd.org Subject: Re: simpliest way to calculate octal? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2003 11:18:26 -0000 --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 10, 2003 at 02:35:35PM +0800, Zhang Weiwu wrote: > Hello. Pretty newbie question again:) >=20 > Today I found I cannot calculate what is the octal form of 0xa04e. >=20 > First I thought xcalc should do the work, but it seems only deal with=20 > decimal. >=20 > I have perl, tcsh, python interprater. It is likely that they are all=20 > capable of this kind, but what are the commands for them? What's the most= =20 > convenient way? >=20 > _________________________________________________________________ > ???????? MSN Explorer: http://explorer.msn.com/lccn =20 >=20 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" > end of the original message You can use 'bc' for this and other conversions: $ echo 'ibase =3D 16; obase =3D 8; A04E' | bc 120116 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 --=20 You can download my public key from http://digilander.libero.it/fcasadei/ or retrieve it from a keyserver (pgpkeys.mit.edu, wwwkeys.pgp.net, ...) Key fingerprint is: 1671 9A23 ACB4 520A E7EE 00B0 7EC3 375F 164E B17B --AhhlLboLdkugWU4S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/r3PvfsM3XxZOsXsRAjShAJ9gWTJroWOZUhehGpK2H/2XKyVhfACaApOL Iw2BTGAj9BwVNjEGpmqFDOc= =b8g+ -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--