From owner-freebsd-questions Sun Jun 24 1:14:53 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-141-144.mmcable.com [24.27.141.144]) by hub.freebsd.org (Postfix) with SMTP id 95A1237B406 for ; Sun, 24 Jun 2001 01:14:48 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 73981 invoked by uid 100); 24 Jun 2001 08:14:47 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15157.41335.592281.637560@guru.mired.org> Date: Sun, 24 Jun 2001 03:14:47 -0500 To: Dan Busarow Cc: tyler spivey , questions@FreeBSD.ORG Subject: Re: program to convert hex to decimal or vise versa? In-Reply-To: References: <15157.26660.156190.806500@guru.mired.org> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dan Busarow types: > On Jun 23, Mike Meyer wrote: > > tyler spivey types: > > > is their a program in ports that i can use > > > to convert hex to dec or vv? i don't use x > > > and want a command line based app. > > Ports nothing. bc is in the base system. I've added prompts for > > clarity, as it doesn't prompt. > I was going to suggest bc too but the questioner required scripts. > Crist had the answer for him and taught me something new too. > printf(1) who came up with that? And when? I didn't see anything about scripts, but bc can do that as well: guru$ echo 'ibase = 16; 1A' | bc 26 Not having to deal with prepending 0x may or may not be an advantage. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message