Subject: Re: echo weirdness
To: None <current-users@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: current-users
Date: 02/18/2004 17:10:01
On Wed, 18 Feb 2004, Patrick Welche wrote:
> There I was surpised that printf "%c" 65 gets me 6, not A, but it is
> what it says in the man page.. any idea how to do int <-> char conversion
> in a script?

printf '\'"$(printf '%o' 65)"

The inner printf outputs "101".
The outer printf sees "\101" as its format parameter, and outputs "A".

--apb (Alan Barrett)