Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!sdd.hp.com!wuarchive!ukma!hsdndev!dartvax!eleazar.dartmouth.edu!mjm From: mjm@eleazar.dartmouth.edu (Andy Behrens) Newsgroups: comp.periphs.printers Subject: Re: How do you send NUL to a printer? Message-ID: <1991May31.175225.7882@dartvax.dartmouth.edu> Date: 31 May 91 17:52:25 GMT References: <2291@twg.bc.ca> Sender: steve@dartvax.dartmouth.edu (Steve Campbell) Reply-To: andyb@coat.com (Andy Behrens) Organization: Burlington Coat Factory Lines: 35 bill@twg.bc.ca (Bill Irwin) writes: > [I have been trying to send a NUL to a printer using] > echo -n "^[C\000011" > > 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. Vi won't show you the NUL characters even though they're in the file, but 'od -c' will. However, that isn't where your problem lies. Many terminal drivers will discard NUL characters on output. You can fool them by sending \200 instead: it won't be discarded, but the high-order bit will be deleted before the printer sees it. Try echo -n "^[C\020011" instead. -- If you've got a hammer, If the only tool you have find a nail. is a hammer, you tend to see (George Bush, January 29, 1991) every problem as a nail. (Abraham Maslow) +-------------------+ | Andy Behrens | or: andyb%coat.com@dartmouth.edu | andyb@coat.com | bitnet: andyb%coat.com@dartcms1 +-------------------+ uucp: {uunet,rutgers}!dartvax!coat.com!andyb