Path: utzoo!utgpu!cunews!micor!ecicrl!clewis From: clewis@ferret.ocunix.on.ca (Chris Lewis) Newsgroups: comp.periphs.printers Subject: Re: How do you send NUL to a printer? Message-ID: <2095@ecicrl.ocunix.on.ca> Date: 1 Jun 91 06:55:10 GMT References: <2291@twg.bc.ca> Organization: Elegant Communications Inc., Ottawa, Canada Lines: 36 In article <2291@twg.bc.ca> bill@twg.bc.ca (Bill Irwin) writes: >Inches: ESC C NUL 11 [set to 11 inch form] >The only difference is the NUL in the inches setting. The way I >have been trying to send this is with: >echo -n "^[C\000011" The above is a little odd - the "-n" implies a Berkeley style echo, but \ escapes aren't in Berkeley echo - they are in the System V echo. >When this is directed to a file and viewed with vi, I get: >^[C11 >Is the NUL supposed to show in vi? When this is sent to the >printer it behaves as though it was sent the Lines setting >command, without the NUL. Is it possible that the NUL is getting >trapped by the system? When I try this with a System V echo, the NUL works, but the -n doesn't. vi *doesn't* show the NUL (even with the "l" command), but it is there. Run "od -c" on the output and you'll see the null sitting there. On the other hand, ^[ *isn't* escape in System V echo. On my machine (System V, Xenix machines should be similar), this works: echo "\033\000011\c" Don't rely on vi to show you any sort of reliable representation of non-printable-ASCII characters. Use "od" for that. -- Chris Lewis, Phone: (613) 832-0541, Domain: clewis@ferret.ocunix.on.ca UUCP: ...!cunews!latour!ecicrl!clewis; Ferret Mailing List: ferret-request@eci386; Psroff (not Adobe Transcript) enquiries: psroff-request@eci386 or Canada 416-832-0541. Psroff 3.0 in c.s.u soon!