Path: utzoo!utgpu!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!cs.utexas.edu!milano!marconi!knutson
From: knutson@marconi.SW.MCC.COM (Jim Knutson)
Newsgroups: comp.unix.wizards
Subject: Re: Generating Octal/Hex Codes from Bourne Shell
Keywords: Bourne Shell Fortune
Message-ID: <1054@marconi.SW.MCC.COM>
Date: 18 Aug 88 15:44:46 GMT
References: <118@gillxp>
Reply-To: knutson@marconi.sw.mcc.com.UUCP (Jim Knutson)
Organization: MCC, Austin, Texas
Lines: 21

In article <118@gillxp> rg@gillxp (Richard J. Gill) writes:
>		echo "\0212"	# 0x8a
>		 ...
>On my Fortune 32:16 (Forpro 2.0 - Sys 3v7 & BSD 4.3), however,
>the string is simply displayed as a literal.  Any ideas on how I
>can generate the fully ASCII set from the Bourne shell on the
>Fortune? 

Well, one way to do it would be to use the tr command.  For instance,
to repeat your examples:

		echo . | tr . '\007'	# 0x07
		echo . | tr . '\212'	# 0x8a

Note that tr expects to have no more than 3 digits so '\0212' won't
give you what you expect.

-- 
Jim Knutson
knutson@mcc.com
cs.utexas.edu!milano!knutson