From owner-freebsd-hackers Sun Jun 22 23:01:43 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA14036 for hackers-outgoing; Sun, 22 Jun 1997 23:01:43 -0700 (PDT) Received: from cais.cais.com (root@cais.com [199.0.216.4]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA14030 for ; Sun, 22 Jun 1997 23:01:40 -0700 (PDT) Received: from earth.mat.net (root@earth.mat.net [205.252.122.1]) by cais.cais.com (8.8.5/) with SMTP id CAA28173; Mon, 23 Jun 1997 02:01:37 -0400 (EDT) Received: from Journey2.mat.net (journey2.mat.net [205.252.122.116]) by earth.mat.net (8.6.12/8.6.12) with SMTP id CAA14675; Mon, 23 Jun 1997 02:01:18 -0400 Date: Mon, 23 Jun 1997 02:01:04 -0400 (EDT) From: Chuck Robey X-Sender: chuckr@Journey2.mat.net Reply-To: Chuck Robey To: Annelise Anderson cc: Brian Somers , "Jordan K. Hubbard" , kleon@bellsouth.net, freebsd-hackers@FreeBSD.ORG Subject: Re: Handbook - ascii form?? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sun, 22 Jun 1997, Chuck Robey wrote: > On Sun, 22 Jun 1997, Annelise Anderson wrote: > > > > > > > On Sun, 22 Jun 1997, Brian Somers wrote: > > > > > Sorry - handbook.ascii is already generated. I was being > > > stupid. I can appreciate that some people have problems with > > > latin - DOS/Win stuff won't grok the ^Hs. I just didn't realize > > > that .ascii is already there - despite being in that code only > > > a few weeks ago. > > > > Well, I'll try this once more. > > > > I think what's happening is that whatever generates handbook.ascii > > is broken. It is indeed generated; it's put on the server; it gets > > downloaded, and this is the result: > > > > FFrreeeeBBSSDD HHaannddbbooookk I posted an answer to this, but I'd better fill in some more, because folks are getting confused. The sample you see above is incorrect, there's really a hidden ^H in there. If you view the file with vi, you see it, but not if you view it with 'less', because "less" knows about groff's attempts at ascii emphasis, so that man pages can look good. Here's a cut and paste from my vi screen, when I view the same line above: F^HFr^Hre^Hee^HeB^HBS^HSD^HD H^HHa^Han^Hnd^Hdb^Hb o^Hoo^Hok^Hk What you see is the letter, then the ^H key telling a printer to backspace over the character, then the same char again. ^H (as most know) is the backspace key on most (non-DEC) terminals. This is the way that boldface is faked. Underline is faked in a very similar way: _^H1_^H. _^HI_^Hn_^Ht_^Hr_^Ho_^Hd_^Hu_^Hc_^Ht_^Hi_^Ho_^Hn is from a page further in the handbook, and says: 1. Introduction with underlining. This looks good on older printers, and pagers like "less" know this also. Notice that the emphasis is of the pattern [some key][backspace key] is the same in both cases. BTW, the source of the emphasis is the groff program, which generates the ascii and postscript output. OK, there's one problem with that. I think that the ftp server is letting folks download handbook.ascii as ascii text, which is eating the backspace keys. Gotta download this as binary! Next probable misunderstanding is the sed script I mentioned. It is right, but not fully described. Here it is again: sed -e "s/.^v^H//g" < handbook.ascii.orig > handbook.ascii The "^V^H" means control-V followed by control-H. Most of you probably know that, but don't know that control-V acts like a control character prefix, so that the following control-H is not interpreted as an attempt to immediately do a backspace, but instead to embed the backspace key into the script. When you hit the control-V, only the "^" will show up, letting you know that the keyboard driver is now ready to accept one control character as raw input, not processed. Then when you hit control-H, the H shows up, so you only see "^H", not "^V^H". That's a way to get control characters into scripts. Works nicely in vi also. The period you see is a wildcarding pattern that means any single character. The "g" at the end says not to stop scanning the input line after finding the first match; instead, continue scanning each line to the end of the line, no matter how many matches are found, and work on all of them. If you want to try this in vi, go ahead, use this: :1,$s/.^V^H//g ----------------------------+----------------------------------------------- Chuck Robey | Interests include any kind of voice or data chuckr@eng.umd.edu | communications topic, C programming, and Unix. 213 Lakeside Drive Apt T-1 | Greenbelt, MD 20770 | I run Journey2 and picnic, both FreeBSD (301) 220-2114 | version 3.0 current -- and great FUN! ----------------------------+-----------------------------------------------