Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!apple!bionet!ig!uwmcsd1!marque!uunet!mcvax!hp4nl!eutrc3!eutwc1!wzv!wietse From: wietse@wzv.UUCP (Wietse Venema) Newsgroups: comp.unix.wizards Subject: Re: Generating Octal/Hex Codes from Bourne Shell Keywords: Bourne Shell Fortune Message-ID: <135@wzv.UUCP> Date: 22 Aug 88 22:10:51 GMT References: <118@gillxp> <1054@marconi.SW.MCC.COM> <2848@quacky.mips.COM> Reply-To: wietse@eutwc1.UUCP (Wietse Venema) Organization: Eindhoven University of Technology, The Netherlands Lines: 23 In article <2848@quacky.mips.COM> dce@quacky.UUCP (David Elliott) writes: }In article <1054@marconi.SW.MCC.COM> knutson@marconi.sw.mcc.com.UUCP (Jim Knutson) writes: }>Well, one way to do it would be to use the tr command. For instance, }>to repeat your examples: } }> echo . | tr . '\007' # 0x07 } }This is a very useful trick. } }One thing it doesn't handle is generating a NUL. I've tried all }kinds of things, but have never found a way to generate a NUL It depends on what you need the null character for. For example, echo . | tr . '\200' is usually ok for output to ttys, since ordinary tty drivers strip the eigth bit (except when in raw mode, of course). -- Wietse Venema uucp: mcvax!eutrc3!wswietse | Eindhoven University of Technology bitnet: wswietse@heitue5 | 5600 MB Eindhoven, The Netherlands