Subject: Re: printf(1) argument doesn't accept hexadecimal
To: Jason R Thorpe <thorpej@zembu.com>
From: Dave Huang <khym@azeotrope.org>
List: netbsd-help
Date: 07/20/2001 14:51:27
On Fri, 20 Jul 2001, Jason R Thorpe wrote:
> On Fri, Jul 20, 2001 at 12:32:57PM -0700, Jeremy C. Reed wrote:
>
>  > I wanted to convert the decimal number from a hexadecimal using printf.
>  >
>  > $ printf "%d\n" 0xC0
>  > bash: printf: 0xC0: illegal number
     ^^^^

Moral of the story: don't use bash ;) printf(1) accepts hex, but bash's
builtin printf doesn't.

> yeah-baby:thorpej 163$ printf "%d\n" 0xC0
> 192
> yeah-baby:thorpej 164$