Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!cmcl2!husc6!bbn!uwmcsd1!marque!uunet!mcvax!hp4nl!philmds!leo
From: leo@philmds.UUCP (Leo de Wit)
Newsgroups: comp.unix.wizards
Subject: Re: Generating Octal/Hex Codes from Bourne Shell
Summary: Use tr
Keywords: Bourne Shell Fortune
Message-ID: <604@philmds.UUCP>
Date: 18 Aug 88 20:48:20 GMT
References: <118@gillxp>
Reply-To: leo@philmds.UUCP (Leo de Wit)
Organization: Philips I&E DTS Eindhoven
Lines: 30

In article <118@gillxp> rg@gillxp (Richard J. Gill) writes:
>I have the need  be able  to generate the full ASCII character
>set from the Bourne shell. There is no problem on my NCR Tower
>XP (System V); I simply use the following syntax:
>
>		echo "\007"	# 0x07
>		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? 

On BSD you can use tr(1) which understands octal codes just in the
way your echo does in System V; the two examples could be rewritten
as:
      tr a "\007"  <