Linux Gazette... making Linux just a little more fun! Copyright © 1996-97 Specialized Systems Consultants, Inc. _________________________________________________________________ Welcome to Linux Gazette! (tm) _________________________________________________________________ Published by: Linux Journal _________________________________________________________________ Sponsored by: InfoMagic S.u.S.E. Red Hat Our sponsors make financial contributions toward the costs of publishing Linux Gazette. If you would like to become a sponsor of LG, e-mail us at sponsor@ssc.com. _________________________________________________________________ Table of Contents October 1997 Issue #22 _________________________________________________________________ * The Front Page * The MailBag + Help Wanted -- Article Ideas + General Mail * More 2 Cent Tips + Netscape and Seyon questions + Keeping track of tips + Displaying File Tree + Making Changing X video modes easier + Tree Program + Finding what you want with find + Minicom kermit help + Postscript printing + Realaudio without X-windows + Connecting to dynamic IP via ethernet + Running commands from X w/out XTerm + Ascii problems with FTP + Red Hat Questions * News Bytes + News in General + Software Announcements * The Answer Guy, by James T. Dennis + Faxing and Dialing-Out on the Same Line + Linux and the 286 + Accessing ext2fs from Windows 95 + chattr +i + Linux sendmail problem + POP3 vs. /etc/passwd + Problem with make + Swap partition and Modems + Redhat 4.2/Motif + E-mail adjustment needed + REALBIOS? + X-Windows Libraries + PC Emulation + Visual Basic for Linux + Linux 4.2 software and Hardware compatablity problems + Moving /usr subdirectory to another drive.. + C++ Integrated Programming Enviroment for X... + LYNX-DEV new to LYNX * Graphics Muse, by Michael J. Hammel * Linux Benchmarking: Part 1 -- Concepts, The first article in a series, by André D. Balsa * New Release Reviews, by Larry Ayers + Word Processing vs. Text Processing? + A New GNU Version of Emacs + Notes-Mode for Emacs * Using m4 To Write HTML, by Bob Hepple * An Introduction to The Connecticut Free Unix Group, by Lou Rinaldi * Review: The Unix-Hater's Handbook, by Andrew Kuchling * The Back Page + About This Month's Authors + Not Linux The Answer Guy The Weekend Mechanic will be back next month _________________________________________________________________ TWDT 1 (text) TWDT 2 (HTML) are files containing the entire issue: one in text format, one in HTML. They are provided strictly as a way to save the contents as one file for later printing in the format of your choice; there is no guarantee of working links in the HTML version. _________________________________________________________________ Got any great ideas for improvements! Send your comments, criticisms, suggestions and ideas. _________________________________________________________________ This page written and maintained by the Editor of Linux Gazette, gazette@ssc.com "Linux Gazette...making Linux just a little more fun!" _________________________________________________________________ The Mailbag! Write the Gazette at gazette@ssc.com Contents: * Help Wanted -- Article Ideas * General Mail _________________________________________________________________ Help Wanted -- Article Ideas _________________________________________________________________ Date: Mon, 25 Aug 1997 15:02:14 -0700 From: cooldude cooldude@digitalcave.com Subject: how do how do i setup a linux server from scratch? my freind has the t1 connection and im gonna admin it with his ermission need ta know A. S.A.P. =) thanks _________________________________________________________________ Date: Mon, 1 Sep 97 18:59:51 UT From: Richard Wang rzlw1@classic.msn.com Hi, I have just set up a system for RedHat Linux, but I am finding getting real support for this system is very difficult. In fact, I cannot even setup my webpage via SLIP from the manuals I have. Redhat seems to go against it'scompetitor Caldera, and I am finding it hard to find the right manuals and guides for this system. Do you have an online help person, who I can log to ? Looking forward to your reply, Richard Wang Cambridge United Kingdom _________________________________________________________________ Date: Wed, 17 Sep 1997 19:49:55 -0700 From: Garry Jackson gjackson@home.com Subject: Linux Problem. I'm a linux newbie and I'm having major problems. I have a monitor that is kapible of 800X600 and I don't know anything else about it. I Also have a Trio 32/64. I cannot get Xwindows to go so what should I do. Also I'm have a problem with my SB16 PNP and I can't get that to work and I can't get a Supra 28.9 PnP and a SN-3200 witch is a NE-200 clone if you could give me any tips on getting this stuff work It would be thanked. Garry Jackson _________________________________________________________________ Date: Wed, 3 Sep 1997 19:28:20 -0400 From: Prow Prowlyr@mindspring.com Subject: Just some really basic help please. I want to learn about unix but really dont know where to start. Can I get a free version somewhere to get me started? Do you know of a good Unix for dummies site that might help? Would greatly appreciate any reply via e-mail. Thanx in advance. _________________________________________________________________ Date: Tue, 09 Sep 1997 00:49:50 +0200 From: Michael Stumpf ms@astat.de Subject: Linux Kernel I'm searching information about the status of the current kernel (release and/or developer). Do you have a web-address from an up-to-date site ? I used to look at "http://www.linuxhq.com" for this, but it seems that it is forever down. tia Michael _________________________________________________________________ Date: Sat, 27 Sep 1997 11:02:04 -0400 From: Dave Runnels drunnels@panix.com Subject: 3com509b problems I recently added a 3com509b Ethernet card to my Win95/Linux machine. I run the machine in PnP mode and the RedHat 4.2 install process won't recognize the card. RedHat's solution was to disable PnP for the machine. While this might be fine for Linux, I am forced to use Win95 for a number of things and turning off PnP (which works great for me on Win95) will be a real pain in the ass. Is there a way I might have my cake and eat it too? I do know which IRQ the card is being assigned to. Thanks, Dave _________________________________________________________________ Date: Mon, 22 Sep 1997 10:06:04 +0200 From: Erwin Penders ependers@cobweb.nl Subject: email only Hi, My name is Erwin Penders an i'm working for a local ISP in the Netherlands. I don't know if i send this mail to the right place, but i have a question about a Linux problem. I want to know how to set up an email-only account (so you can call the ISP, make a connection and send/receive email) without the possiblity for WWW, Telnet etc. The main problem is that i don't know how to set up the connection (the normal accounts get a /etc/ppp/ppplogin).... . . Can anybody help me with this problem !? Thanks, Erwin Penders (CobWeb) _________________________________________________________________ Date: Sat, 20 Sep 1997 22:00:38 +0200 From: Richard Torkar richard.torkar@goteborg.mail.telia.com Subject: Software for IDE cd-r? First of all Thanks for a great e-zine! And then to my question... (You didn't really think that I wrote to you just to be friendly did you? ;-) Is there any software written for IDE cd-r for example Mitsumi CR2600TE? I found two programs; Xcdroast and CDRecord for Linux, but unfortunately they don't support IDE cd-r :-( I haven't found anything regarding this problem and I've used darned near all search tools on the net... Any answer would be appreciated. If the answer is no, can I solve this problem somehow? Regards, Richard Torkar from the lovely land of ice beers .. ;-) _________________________________________________________________ Date: Thu, 18 Sep 1997 16:03:04 -0400 (EDT) From: Eric Maude sabre2@mindspring.com Subject: Redhat Linux 4.3 Installation Help I am trying to install Redhat Linux 4.3 on a Windows 95 (not OSR 2) machine. I do want to set this machine up as dual boot but that's not really my problem. I have been totally unable to set up Linux because I am unable to set up the Non-MS DOS partition that Linux requires. I am pretty new to Linux. I would appreciate anyone that could give me detailed step by step instructions on how I go about setting up Redhat Linux. I would call Redhat directly but I am at work during their operating hours and not near the machine I need help with this! Please, somebody help me out!! Thanks!! _________________________________________________________________ General Mail _________________________________________________________________ Date: Fri, 29 Aug 1997 11:02:39 -0300 From: Mario Storti mstorti@minerva.unl.edu.ar Subject: acknowledge to GNU software (Sorry if this is off-topic) From now on I will put a mention to the GNU (and free in general) software I make use in the "acknowledgment" section of my (scientific) papers. I suggest to do the same to all those who are working on scientific applications. Since Linux is getting stronger every day in the scientific community, this could represent an important support, specially when requesting funding. Even better would be to make a database with all these "acknowledgments" in a Web site or something similar. Do anyone know of something like this that is already working? Any comments? Mario _________________________________________________________________ Date: Sun, 07 Sep 1997 23:58:16 -0500 From: mike shimanski mshiman@xnet.com Subject: Fun I just discovered Linux in July and am totally pleased. After years of Dos, Win 3.1, OS/2 and Win95, ( I won't discuss my experience with Apple), I think I found an operating system I can believe in.I cannot make this thing crash! The Linux Gazette has been a rich source of information and makes being a newbe a great deal easier.I want to thank you for the time and effort you put into this publication. It has made my induction into the Linux world a lot easier. Did I mention I am having way too much fun exploring this operating system? Am I wierd or what? Again, thanks for a great resource. Mike Shimanski _________________________________________________________________ Date: Sat, 06 Sep 1997 18:01:52 -0700 From: George Smith gbs@swdc.stratus.com Subject: Issue 21 THANKS! Thanks! Thank You! Issue 21 was great! I loved it! I most appreciate the ability to download it to local disk and read it without my network connection being live and with the speed of a local disk. Please keep offering this feature - I wish everyone did. BTW, I am a subscriber to the Linux Journel from issue 1 and enjoy it immensely also. Thanks again. _________________________________________________________________ Date: Wed, 03 Sep 1997 19:34:29 -0500 From: Mark C. Zolton trustno1@kansas.net Subject: Thank you Linux Gazzette Hello There, I just wanted to thank you for producing such a wonderful publication. As a relative newbie to Linux, I have found your magazine of immense use in answering the plethora of questions I have. Keep up the good work. Maybe oneday I'll be experienced enough to write for you. Mark _________________________________________________________________ Date: Mon, 1 Sep 1997 00:09:53 -0500 (CDT) From: Arnold Hennig amjh@qns.com Subject: Response to req. for help - defrag I saw the request for information about the (lack of) need for defragging in issue 20, and have just been studying the disk layout a bit anyway. Hope the following is helpful: In reference to the question titled "Disk defrag?" in issue 20 of the Linux Gazette: I had the same question in the back of my mind once I finally Linux up and running after some years of running a DOS based computer. After I was asked the same question by someone else, I poked around a bit and did find a defrag utility buried someplace on sunsite. The documentation pretty much indicated that with the ext2 file system it is rarely necessary to use the utility (he wrote it prior to the general use of ext2fs). He gave a bit of an explanation and I found some additional information the other day following links that (I believe) originated in the Gazette. Basically, DOS does not keep a map of the disk usage in memory, and each new write simply starts from the next available free cluster (block), writes till it gets to the end of the free space and then jumps to the next free space and continues. After it reaches the end of the disk or at the next reboot, the "next free cluster" becomes the "first free cluster", which is probably where something was deleted, and may or may be an appropriate amount of free space for the next write. There is no planning ahead for either using appropriate sized available spaces or for clustering related files together. The result is that the use of space on the disk gets fragmented and disorganized rather quickly, and the defrag utilities are a necessary remedy. In fairness to DOS, it was originally written for a computer with precious little memory, and this method of allocating write locations didn't strain the resources much. The mounting requirement under unices allows the kernel to keep a map of the disk usage and allocate disk space more intelligently. The Ext2 filesystem allocates writes in "groups" spread across the area of the disk, and allocates files in the same group as the directory to which they belong. This way the disk optimization is done as the files are written to disk, and a separate utility is not needed to accomplish it. Your other probable source of problems is unanticipated shutdowns (power went out, Dosemu froze the console and you don't have a way to dial in through the modem to kill it - it kills clean, btw ;-), or your one year old niece discovered the reset button). This will tend to cause lost cluster type problems with the files you had open at the time, but the startup scripts almost universally run fsck, which will fix these problems. You WILL notice the difference in the startup time when you have had an improper shutdown. So, yes, you may sleep with peace of mind in this respect. Arnold M.J. Hennig _________________________________________________________________ Date: Wed, 3 Sep 1997 16:19:17 -0600 (MDT) From: Mark Midgley midgley@pht.com Subject: Commercial Distribution Mo'Linux, a monthly Linux distribution produced by Pacific HiTech, Inc. includes current Linux Gazette issues. They are copied in whole, according to the copyright notice. Mark _________________________________________________________________ Date: Thu, 11 Sep 1997 12:26:53 -0400 From: Brian Connors connorbd@bc.edu Subject: Linux and Mac worlds vs Microsoft? Michael Hammel made an interesting comment in the September letters column about aligning with Mac users against Microsoft. The situation's not nearly as rosy as all that, what with Steve Jobs' latest activity in the Mac world. As a Mac diehard, I'm facing the prospect of a good platform being wiped out by its own creator, whether it's really his attention or not. IMHO the Linux world should be pushing for things like cheap RISC hardware (which IBM and Motorola have but aren't pushing) and support from companies like Adobe. I know that in my case, if the MacOS is robbed of a future, I won't be turning to Windows for anything but games... _________________________________________________________________ Date: Thu, 11 Sep 1997 22:59:19 +0900 From: mark stuart mark@www.hotmail.com Subject: article ideas why not an issue on linux on sparc and alpha(especially for scientific applications) and also how about an issue on SMP with linux? _________________________________________________________________ Date: Sat, 27 Sep 1997 01:57:09 -0700 (PDT) From: Ian Justman ianj@chocobo.org Except for the SNA server, all I've got to say about Linux with all the necessary software is: "Eat your heart out, BackOffice!" --Ian. _________________________________________________________________ Date: Wed, 24 Sep 1997 21:49:28 -0700 From: Matt Easton measton@lausd.k12.ca.us Subject: Thanks Thank you for Linux Gazette. I learn a lot there; and also feel more optimistic about things not Linux after visiting. _________________________________________________________________ Date: Fri, 26 Sep 1997 13:24:29 -0500 From: "Samuel Gonzalez, Jr." buzz@pdq.net Subject: Excellent Job Excellent job !!! Sam _________________________________________________________________ Published in Linux Gazette Issue 22, October 1997 _________________________________________________________________ [ TABLE OF CONTENTS ] [ FRONT PAGE ] Next This page written and maintained by the Editor of Linux Gazette, gazette@ssc.com Copyright © 1997 Specialized Systems Consultants, Inc. _________________________________________________________________ "Linux Gazette...making Linux just a little more fun! " _________________________________________________________________ More 2˘ Tips! Send Linux Tips and Tricks to gazette@ssc.com _________________________________________________________________ Contents: * Netscape and Seyon questions * Keeping track of tips * Displaying File Tree * Making Changing X video modes easier * Tree Program * Finding what you want with find * Minicom kermit help * Postscript printing * Realaudio without X-windows * Connecting to dynamic IP via ethernet * Running commands from X w/out XTerm * Ascii problems with FTP * Red Hat Questions _________________________________________________________________ Netscape and Seyon questions Date: Mon, 8 Sep 1997 11:23:51 -0600 (MDT) From: "Michael J. Hammel" mjhammel@long.emass.com Lynn Danielson asked: I downloaded Netscape Communicator just a few weeks ago from the Netscape site. I'm not sure older versions of Netscape are still available. I'm probably wrong, but I was under the impression that only the most current beta versions were freely available. Answer: A quick search through Alta-Vista for Netscape mirrors showed a couple of different listing for mirror sites. I perused a few and found most either didn't have anything or had non-English versions, etc. One site I did find with all the appropriate pieces is: ftp://ftp.adelaide.edu.au/pub/WWW/Netscape/pub/ Its a long way to go to get it (Australia), but thats all I could find. If you want to go directly to the latest (4.03b8) Communicator directory, try: ftp://ftp.adelaide.edu.au/pub/WWW/Netscape/pub/communicator/4.03/4.03b 8/english/unix/ I did notice once while trying to download from Netscape that older versions were available, although I didn't try to download them. I noticed this while looking for the latest download of Communicator through their web sites. Can't remember how I found that, though. The 3.x version is available commercially from Caldera. I expect that the 4.x versions will be as well, though I don't know if Caldera keeps the beta versions on their anonymous ftp sites. BTW, the Page Composer is pretty slick, although it has no interface for doing Javascript. It has a few bugs, but its the best WYSIWYG interface for HTML composition on Linux that I've seen. Its better than Applix's HTML Editor, although that one does allow exporting to non-HTML stuff. Collabra Discussions sucks. The old news reader was better at most things. I'd still like to be able to mark a newsgroup read up to a certain point instead of the all-or-nothing bit. For anyone who is interested - 4.x now supports CSS (Cascading Style Sheets) and layers. Both of these are *very* cool. They are the future of Web design and, IMHO, a very good way to create Multimedia applications for distribution on CDs. One of C|Net's web pages (I think) has some info on these items, including a demo of layers (moves an image all over the screen *over* the underlying text - way cool). The only C|Net URL I ever remember is www.news.com, but you can get to the rest of their sites from there. -- Michael J. Hammel _________________________________________________________________ Keeping track of tips Date: Tue, 26 Aug 1997 16:29:13 +0200 From: Ivo Saviane saviane@astrpd.pd.astro.it Dear LG, it always happens to me that I spend a lot of time finding out how to do a certain thing under Linux/Unix, and then I forget it. The next time I need that information I will start all the `find . ...', `grep xxx *' process again and waste the same amount of time! To me, the best way to avoid that is to send a mail to myself telling how to do that particular operation. But mail folders get messy and, moreover, are not useful to other users who might need that same information. Finally I found something that contributes solving this problem. I set up a dummy user who reads his mail and puts it in www readable form. Now it is easy for me to send a mail to news@machine as soon as I learn something, and be sure that I will be able to find that information again just clicking on the appropriate link. It would also be easy to set up a grep script and link it to the same page. The only warning is to put a meaningful `subject: ' to the mail, since this string will be written besides the link. I am presently not aware of something similar. At least, not that simple. It you know, let me know too! If you want to see how this works, visit http://obelix.pd.astro.it/~news A quick description of the basic operations needed is given below. ---------------------------------------------------------------------- ---- The following lines briefly describe how to set up the light news server. 1. Create a new user named `news' 2. Login as news and create the directories ~/public_html and ~/public_html/folders (I assume that your http server is configured so that `http://machine/~user' will point to `public_html' in the user's $HOME). 3. Put the wmanager.sh script in the $HOME/bin directory. The script follows the main body of this message as attachment [1]. The script does work under bash. The relevant variables are grouped at the beginning of the script. These should be changed according to the machine/user setup 4. The script uses splitmail.c in order to break the mail file in sub-folders The binary file should be put in the $HOME/bin dir. See attachment [2]. 5. Finally, add a line in the `news' user crontab, like the following 00 * * * * /news_bin_dir/wmanager.sh where `news_bin_dir' stands for $HOME/bin. In this case the mail will be checked once every hour. ---------------------------------- attachment [1] #!/bin/sh # wmanager.sh # Updates the www news page reading the user's mails # (c) 1997 Ivo Saviane # requires splitmail (attachment [2]) ## --- environment setup BIN=/home/obelnews/bin # contains all the executables MDIR=/usr/spool/mail # mail files directory USR=news # user's login name MFOLDER=$MDIR/$USR # user's mail file MYFNAME=`date +%y~%m~%d~%H:%M:%S.fld` # filename for mail storage under www FLD=folders # final dir root name PUB=public_html # httpd declared public directory PUBDIR=$HOME/$PUB/$FLD MYFOLDER=$PUBDIR/$MYFNAME INDEX=$HOME/$PUB/index.html ## --- determines the mailfile size MSIZE=`ls -l $MFOLDER | awk '{print $5}'` ## --- if new mail arrived goes on; otherwise does nothing if [ $MSIZE != "0" ]; then ## --- writes the header of index.html in the pub dir echo "
" >> $INDEX echo "Last update: `date`
This is some plain text
_HEAD1(`This is a main heading')
This is some more plain text
_TRAILER
The format is simple - just HTML code but you can now include files
and add macros rather like in C. I use a convention that my new macros
are in capitals and start with "_" to make them stand out from HTML
language and to avoid name-space collisions.
The m4 file is then processed as follows to create an .html file e.g.
m4 -P
m4_divert(-1)
m4_define(`_H1_num',0)
m4_define(`_H2_num',0)
m4_define(`_H3_num',0)
m4_define(`_H4_num',0)
m4_divert(1)')
m4_define(_H1, `m4_divert(-1)
m4_define(`_H1_num',m4_incr(_H1_num))
m4_define(`_H2_num',0)
m4_define(`_H3_num',0)
m4_define(`_H4_num',0)
m4_define(`_TOC_label',`_H1_num. $1')
m4_divert(0) ')
One restriction is that you should not use diversions within your
text, unless you preserve the diversion to file 1 used by this TOC
generator.
Contents
3.8 Simple tables
Other than Tables of Contents, many browsers support tabular
information. Here are some funky macros as a short cut to producing
these tables. First, an example of their use:
$1
)
If, later, you decide you prefer instead of it is a
simple matter to change the definition and then every _MYQUOTE
paragraph falls into line with a quick make.
The classic guides to good HTML writing say things like "It is
strongly recommended that you employ the logical styles such as
... rather than the physical styles such as ... in
your documents." Curiously, the WYSIWYG editors for HTML generate
purely physical styles. Using these m4 styles may be a good way to
keep on using logical styles.
Contents
3.4 Typing and mnemonic aids
I don't depend on WYSIWYG editing (having been brought up on troff)
but all the same I'm not averse to using help where it's available.
There is a choice (and maybe it's a fine line) to be made between:
and:
_CODE(Some code you want to display.)
In this case, you would define _CODE like this:
m4_define(`_CODE',
Some code you want to display.
)
Which version you prefer is a matter of taste and convenience although
the m4 macro certainly saves some typing and ensures that HTML codes
are not interleaved. Another example I like to use (I can never
remember the syntax for links) is:
m4_define(`_LINK', $2)
Then,
Click here to get to SOMEWHERE
becomes:
_LINK(`URL_TO_SOMEWHERE', `Click here to get to SOMEWHERE')
Contents
3.5 Automatic numbering
m4 has a simple arithmetic facility with two operators m4_incr and
m4_decr which act as you might expect - this can be used to create
automatic numbering, perhaps for headings, e.g.:
m4_define(_CARDINAL,0)
m4_define(_H, `m4_define(`_CARDINAL',
m4_incr(_CARDINAL))$1
_CARDINAL.0 $1
')
_H(First Heading)
_H(Second Heading)
This produces:
1.0 First Heading
2.0 Second Heading
Contents
3.6 Automatic date stamping
For simple, datestamping of HTML pages I use the m4_esyscmd command to
maintain an automatic timestamp on every page:
This page was updated on m4_esyscmd(date)
which produces:
This page was last updated on Fri May 9 10:35:03 HKT 1997
Of course, you could also use the date, revision and other facilities
of revision control systems like RCS or SCCS, e.g. $Date$.
Contents
3.7 Generating Tables of Contents
Using m4 allows you to define commonly repeated phrases and use them
consistently - I hate repeating myself because I am lazy and because I
make mistakes, so I find this feature absolutely key.
A good example of the power of m4 is in building a table of contents
in a big page (like this one). This involves repeating the heading
title in the table of contents and then in the text itself. This is
tedious and error-prone especially when you change the titles. There
are specialised tools for generating tables of contents from HTML
pages but the simple facility provided by m4 is irresistable to me.
3.7.1 Simple to understand TOC
The following example is a fairly simple-minded Table of Contents
generator. First, create some useful macros in stdlib.m4:
m4_define(`_LINK_TO_LABEL', $1)
m4_define(`_SECTION_HEADER', $1
)
Then define all the section headings in a table at the start of the
page body:
m4_define(`_DIFFICULTIES', `The difficulties of HTML')
m4_define(`_USING_M4', `Using m4')
m4_define(`_SHARING', `Sharing HTML Elements Across Several Pages')
Then build the table:
Finally, write the text:
.
.
_SECTION_HEADER(_DIFFICULTIES)
.
.
The advantages of this approach are that if you change your headings
you only need to change them in one place and the table of contents is
automatically regenerated; also the links are guaranteed to work.
Hopefully, that simple version was fairly easy to understand.
Contents
3.7.2 Simple to use TOC
The Table of Contents generator that I normally use is a bit more
complex and will require a little more study, but is much easier to
use. It not only builds the Table, but it also automatically numbers
the headings on the fly - up to 4 levels of numbering (e.g. section
3.2.1.3 - although this can be easily extended). It is very simple to
use as follows:
1. Where you want the table to appear, call Start_TOC
2. at every heading use _H1(`Heading for level 1') or _H2(`Heading
for level 2') as appropriate.
3. After the very last HTML code (probably after ), call
End_TOC
4. and that's all!
The code for these macros is a little complex, so hold your breath:
m4_define(_Start_TOC,`
_TOC_label
')
.
.
[definitions for _H2, _H3 and _H4 are similar and are
in the downloadable version of stdlib.m4]
.
.
m4_define(_End_TOC,`m4_divert(0)')
m4_define(`_Table_Hdr_Item', `
)
Contents
4. m4 gotchas
Unfortunately, m4 is not unremitting sweetness and light - it needs
some taming and a little time spent on familiarisation will pay
dividends. Definitive documentation is available (for example in
emacs' info documentation system) but, without being a complete
tutorial, here are a few tips based on my fiddling about with the
thing.
4.1 Gotcha 1 - quotes
m4's quotation characters are the grave accent ` which starts the
quote, and the acute accent ' which ends it. It may help to put all
arguments to macros in quotes, e.g.
_HEAD1(`This is a heading')
The main reason for this is in case there are commas in an argument to
a macro - m4 uses commas to separate macro parameters, e.g. _CODE(foo,
bar) would print the foo but not the bar. _CODE(`foo, bar') works
properly.
This becomes a little complicated when you nest macro calls as in the
m4 source code for the examples in this paper - but that is rather an
extreme case and normally you would not have to stoop to that level.
Contents
4.2 Gotcha 2 - Word swallowing
The worst problem with m4 is that some versions of it "swallow" key
words that it recognises, such as "include", "format", "divert",
"file", "gnu", "line", "regexp", "shift", "unix", "builtin" and
"define". You can protect these words by putting them in m4 quotes,
for example:
Smart people `include' Linux in their list
of computer essentials.
The trouble is, this is a royal pain to do - and you're likely to
forget which words need protecting.
Another, safer way to protect keywords (my preference) is to invoke m4
with the -P or --prefix-builtins option. Then, all builtin macro names
are modified so they all start with the prefix m4_ and ordinary words
are left alone. For example, using this option, one should write
m4_define instead of define (as shown in the examples in this
article).
The only trouble is that not all versions of m4 support this option -
notably some PC versions under M$-DOS. Maybe that's just another
reason to steer clear of hack code on M$-DOS and stay with Linux!
Contents
4.3 Gotcha 3 - Comments
Comments in m4 are introduced with the # character - everything from
the # to the end of the line is ignored by m4 and simply passed
unchanged to the output. If you want to use # in the HTML page then
you would need to quote it like this - `#'. Another option (my
preference) is to change the m4 comment character to something exotic
like this: m4_changecom(`[[[[') and not have to worry about `#'
symbols in your text.
If you want to use comments in the m4 file which do not appear in the
final HTML file, then the macro m4_dnl (dnl = Delete to New Line) is
for you. This suppresses everything until the next newline.
m4_define(_NEWMACRO, `foo bar') m4_dnl This is a comment
Yet another way to have source code ignored is the m4_divert command.
The main purpose of m4_divert is to save text in a temporary buffer
for inclusion in the file later on - for example, in building a table
of contents or index. However, if you divert to "-1" it just goes to
limbo-land. This is useful for getting rid of the whitespace generated
by the m4_define command, e.g.:
m4_divert(-1) diversion on
m4_define(this ...)
m4_define(that ...)
m4_divert diversion turned off
Contents
4.4 Gotcha 4 - Debugging
Another tip for when things go wrong is to increase the amount of
error diagnostics that m4 emits. The easiest way to do this is to add
the following to your m4 file as debugging commands:
m4_debugmode(e)
m4_traceon
.
.
buggy lines
.
.
m4_traceoff
Contents
5. Conclusion
"ah ha!", I hear you say. "HTML 3.0 already has an include statement".
Yes it has, and it looks like this:
The problem is that:
* The work of including and interpreting the include is done on the
server-side before downloading and adds a big overhead as the
server has to scan files for `include' statements.
* Consequently most servers (especially public ISP's) deactivate
this feature.
* `include' is all you get - no macro substitution, no parameters to
macros, no ifdef, etc, etc.
There are several other features of m4 that I have not yet exploited
in my HTML ramblings so far, such as regular expressions and doubtless
many others. It might be interesting to create a "standard" stdlib.m4
for general use with nice macros for general text processing and HTML
functions. By all means download my version of stdlib.m4 as a base for
your own hacking. I would be interested in hearing of useful macros
and if there is enough interest, maybe a Mini-HOWTO could evolve from
this paper.
There are many additional advantages in using Linux to develop HTML
pages, far beyond the simple assistance given by the typical Typing
Aids and WYSIWYG tools.
Certainly, this little hacker will go on using m4 until HTML catches
up - I will then do my last make and drop back to using pure HTML.
I hope you enjoy these little tricks and encourage you to contribute
your own. Happy hacking!
6. Files to download
You can get the HTML and the m4 source code for this article here (for
the sake of completeness, they're copylefted under GPL 2):
using_m4.html :this file
using_m4.m4 :m4 source
stdlib.m4 :Include file
makefile
Contents
_________________________________________________________________
Copyright © 1997, Bob Hepple
Published in Issue 22 of the Linux Gazette, October 1997
_________________________________________________________________
[ TABLE OF CONTENTS ] [ FRONT PAGE ] Back Next
_________________________________________________________________
"Linux Gazette...making Linux just a little more fun!"
_________________________________________________________________
An introduction to The Connecticut Free Unix Group
by Lou Rinaldi lou@cfug.org, CFUG Co-Founder
_________________________________________________________________
October of 1996 was when Nate Smith and I first began discussing the
creation of a local-area unix users' group here in Connecticut,
something we felt the area was desperately in need of. We bantered
around some initial ideas; some great, some not so great. Finally we
decided on creating a group whose focus was on the "free unix"
community. CFUG, The Connecticut Free Unix Group, was born in November
of 1996. Both of us had very busy schedules, so all of the time we
were going to invest in this project came directly from our
ever-decreasing periods of leisure activity. We agreed upon three
major goals for CFUG: The first was the wide distribution and
implementation of free, unix-like operating systems and software. The
second was educating the public about important developments in the
evolution of free operating systems. Finally, we strove to provide an
open, public forum for debate and discussion about issues related to
these topics. After writing to several major vendors and asking for
donations of their surplus stock and/or older software releases, the
packages began rolling in. (After all, we wanted to create some sort
of incentive for people to come to the first meeting)! We then got
started doing some heavy advertising on the newsgroups, in local
computer stores and also on local college campuses. Finally, after
securing an honored guest speaker for our first meeting, (Lar Kaufman,
co-author of the seminal reference book "Running Linux"), we were
ready to set a date. December 9th, 1996 marked the first official CFUG
gathering, which took place at a local public library. We've held
meetings on the second Monday of each month ever since, and are now
widely recognized as Connecticut's only organization dedicated to the
entire free unix community. We've since lost Nate Smith to the
lucrative wiles of Silicon Valley, but we continue to carry on with
our original goals. We have close relations with companies such as
Caldera Inc., InfoMagic Inc., and Red Hat Software, as well as such
non-commercial entities as The FreeBSD Project, Software In The Public
Interest (producers of Debian GNU/Linux), The OpenBSD Project and The
Free Software Foundation. We were also featured on the front page of
the Meriden Record-Journal, a major local newspaper, on May 26th of
this year. Our future plans include more guest speakers, as well as
trips to events of pertinence throughout New England.
For more information, please check our website - http://www.cfug.org
There is a one-way mailing list for announcements concerning CFUG. You
can sign up by emailing cfug-announce-request@cfug.org with
"subscribe" as the first line of the message body (without the
quotes).
_________________________________________________________________
Copyright © 1997, Lou Rinaldi
Published in Issue 22 of the Linux Gazette, October 1997
_________________________________________________________________
[ TABLE OF CONTENTS ] [ FRONT PAGE ] Back Next
_________________________________________________________________
"Linux Gazette...making Linux just a little more fun!"
_________________________________________________________________
Review: The Unix-Hater's Handbook
by Andrew Kuchling amk@magnet.com
_________________________________________________________________
I've written a review of an old (1994-vintage) book that may be of
interest to Linuxers. While even just its title will annoy people,
there actually is material of interest in the book to Linux developers
and proponents.
Andrew Kuchling
amk@magnet.com
http://starship.skyport.net/crew/amk/
_________________________________________________________________
The UNIX-HATERS Handbook (1994)
by Simson Garfinkel, Daniel Weise, and Steven Strassman.
Foreword by Donald Norman
Anti-Forward by Dennis Ritchie.
Summary: A sometimes enraging book for a Linux fan, but there are
valuable insights lurking here.
In his Anti-Forward to this book, Dennis Ritchie writes "You claim to
seek progress, but you succeed mainly in whining." That's a pretty
accurate assessment of this book; it's one long complaint about work
lost due to crashes, time wasted finding workarounds for bugs, unclear
documentation, and obscure command-line arguments. Similar books could
be written about any operating system. Obviously, I don't really agree
with this book; I wouldn't be using Linux if I did. However, there is
informative material here for people interested in Linux development,
so it's worth some attention.
The book describes problems and annoyances with Unix; since it was
inspired by a famous mailing list called UNIX-HATERS, there are lots
of real-life horror stores, some hilarious and some wrenching. The
shortcomings described here obviously exist, but in quite a few cases
the problem has been fixed, or rendered irrelevant, by further
development. Two examples:
* On the Unix file system: "...since most disk drives can transfer up
to 64K bytes in a single burst, advanced file systems store files in
contiguous blocks so they can be read and written in a single
operation ... All of these features have been built and fielded in
commercially offered operating systems. Unix offers none of them." But
the ext2 file system, used on most Linux systems, does do this;
there's nothing preventing the implementation of better filesystems.
* "Unix offers no built-in system for automatically encrypting files
stored on the hard disk." (Do you know of any operating system that
has such capability out of the box? Can you imagine the complaints
from users who forget their passwords?) Anyway, software has been
written to do this, either as an encrypting NFS server (CFS) or as a
kernel module (the loopback device).
There are some conclusions that I draw from reading this book:
First, when the book was written in 1994, the free Unixes weren't very
well known, so the systems described are mostly commercial ones.
Proponents of free software should notice how many of the problems
stem from the proprietary nature of most Unix variants at the time of
writing. The authors point out various bugs and missing features in
shells and utilities, flaws which could be *fixed* if the source code
was available.
Better solutions sometimes didn't become popular, because they were
owned by companies with no interest in sharing the code. For example,
the book praises journalled file systems such as the Veritas file
system, because they provide faster operation, and are less likely to
lose data when the computer crashes. The authors write, "Will
journaling become prevalent in the Unix world at large? Probably not.
After all, it's nonstandard." More importantly, I think, the file
system was proprietary software, and companies tend to either keep the
code secret (to preserve their competitive advantage), or charge large
fees to license the code (to improve their balance sheets).
The chapter on the X Window System is devastating and accurate; X
really is an overcomplicated system, and its division between client
and server isn't always optimal. An interesting solution is suggested;
let programs extend the graphics server by sending it code. This
approach was used by Sun's NeWS system, which used PostScript as the
language. Unfortunately NeWS is now quite dead; it was a proprietary
system, after all, and was killed off by X, which was freely available
from MIT. (Trivia: NeWS was designed by James Gosling, who is now
well-known for designing Java. Sun seems determined not to make the
same mistake with Java... we hope.)
Second, many of the problems can be fixed by integrating better tools
into the system. The Unix 'find' command has various problems which
are described in chapter 8 of the book, and are pretty accurate,
though they seem to have been fixed in GNU find. Someone has also
written GNU locate, an easier way to find files. It runs a script
nightly to build a database of filenames, and the 'locate' command
searches through that database for matching files. You could make this
database more than just a list of filenames; add the file's size and
creation time, and you can do searches on those fields. One could
envision a daemon which kept the database instantly up to date with
kernel assistance. The source is available, so the idea only needs an
author to implement it...
Chapter 8 also points out that shell programming is complex and
limited; shell scripts depend on subprograms like 'ls' which differ
from system to system, making portability a problem, and the quoting
rules are elaborate and difficult to apply recursively. This is true,
and is probably why few really sizable shell scripts are written
today; instead, people use scripting language like Perl or Python,
which are more powerful and easier to use.
Most important for Linux partisans, though, it's very important to
note that not all of the flaws described have been fixed in Linux yet!
For example, most Linux distributions don't really allow you to
undelete files, though the Midnight Commander program apparently
supports undeletes. As the authors say, 'sendmail' really is very
buggy, and Unix's security model isn't very powerful. But people are
working on new programs that do sendmail's job, and they're coding
security features like the immutable attributes, and debating new
security schemes.
For this reason, the book is very valuable as a pointer to things
which still need fixing. I'd encourage Linux developers, or people
looking for a Linux project, to read this book. Your blood pressure
might soar as you read it, but look carefully at each complaint and
ask "Is this complaint really a problem? If yes, how could it be
fixed, and the system improved? Could I implement that improvement?"
_________________________________________________________________
Copyright © 1997, Andrew Kuchling
Published in Issue 22 of the Linux Gazette, October 1997
_________________________________________________________________
[ TABLE OF CONTENTS ] [ FRONT PAGE ] Back Next
_________________________________________________________________
Linux Gazette Back Page
Copyright © 1997 Specialized Systems Consultants, Inc.
For information regarding copying and distribution of this material see the
Copying License.
_________________________________________________________________
Contents:
* About This Month's Authors
* Not Linux
_________________________________________________________________
About This Month's Authors
_________________________________________________________________
Larry Ayers
Larry Ayers lives on a small farm in northern Missouri, where he is
currently engaged in building a timber-frame house for his family. He
operates a portable band-saw mill, does general woodworking, plays the
fiddle and searches for rare prairie plants, as well as growing
shiitake mushrooms. He is also struggling with configuring a Usenet
news server for his local ISP.
Jim Dennis
Jim Dennis is the proprietor of Starshine Technical Services. His
professional experience includes work in the technical support,
quality assurance, and information services (MIS) departments of
software companies like Quarterdeck, Symantec/ Peter Norton Group, and
McAfee Associates -- as well as positions (field service rep) with
smaller VAR's. He's been using Linux since version 0.99p10 and is an
active participant on an ever-changing list of mailing lists and
newsgroups. He's just started collaborating on the 2nd Edition for a
book on Unix systems administration. Jim is an avid science fiction
fan -- and was married at the World Science Fiction Convention in
Anaheim.
John M. Fisk
John Fisk is most noteworthy as the former editor of the Linux
Gazette. After three years as a General Surgery resident and Research
Fellow at the Vanderbilt University Medical Center, John decided to
":hang up the stethoscope":, and pursue a career in Medical
Information Management. He's currently a full time student at the
Middle Tennessee State University and hopes to complete a graduate
degree in Computer Science before entering a Medical Informatics
Fellowship. In his dwindling free time he and his wife Faith enjoy
hiking and camping in Tennessee's beautiful Great Smoky Mountains. He
has been an avid Linux fan, since his first Slackware 2.0.0
installation a year and a half ago.
Michael J. Hammel
Michael J. Hammel, is a transient software engineer with a background
in everything from data communications to GUI development to
Interactive Cable systems--all based in Unix. His interests outside of
computers include 5K/10K races, skiing, Thai food and gardening. He
suggests if you have any serious interest in finding out more about
him, you visit his home pages at http://www.csn.net/~mjhammel. You'll
find out more there than you really wanted to know.
Bob Hepple
Bob Hepple has been hacking at Unix since 1981 under a variety of
excuses and has somehow been paid for it at least some of the time.
It's allowed him to pursue another interest - living in warm, exotic
countries including Hong Kong, Australia, Qatar, Saudi Arabia, Lesotho
and (presently) Singapore. His initial aversion to the cold was
learned in the UK. Ambition - to stop working for the credit card
company and taxman and to get a real job - doing this, of course!
_________________________________________________________________
Not Linux
_________________________________________________________________
Thanks to everyone who contributed to this month's issue!
I'm very excited to edit the Linux Gazette for October.
At my last job, where I fixed computers for a big company, I was
talking with a woman about life in general while fixing her computer,
and suddenly she blurted: "Oh my God! You're really a computer geek!"
She immediately apologized and explained that she didn't mean any
offense, even though I had a huge smile on my face and was trying to
explain that I appreciated the compliment.
After many experiences like that, working with SSC has been a welcome
change. And since Linux Gazette is one of the places where geeks come
home to roost, I'm happy to be a part of it.
I just came back from the Grace Hopper Celebration for Women in
Computing, which was held in San Jose, California this year. To quote
Bill and Ted, it was totally awesome! I got to meet the illustrious
Anita Borg, the amazing Ruzena Bajcny, and the inspiring Fran Allen
from IBM, as well as many many many others who came from all over the
country, and from dozens of countries from around the world. It was
the most incredible even that I have ever attended, and I encourage
everyone to go to the next one which will be in the year 2000.
Margie Richardson will return next month as Editor-In-Chief, and I'll
be helping out on the sidelines. I'm really glad that I got the chance
to be the Big Cheese for a month. :)
Keep sending those articles to gazette@ssc.com!
Until next month, keep reading and keep hacking!
_________________________________________________________________
Viktorie Navratilova
Editor, Linux Gazette gazette@ssc.com
_________________________________________________________________
[ TABLE OF CONTENTS ] [ FRONT PAGE ] Back
_________________________________________________________________
Linux Gazette Issue 22, October 1997, http://www.ssc.com/lg/
This page written and maintained by the Editor of Linux Gazette,
gazette@ssc.com
$1
m4_ifelse($#,1,,`_Table_Hdr_Item(m4_shift($@))')')
m4_define(`_Table_Row_Item', `$1
m4_ifelse($#,1,,`_Table_Row_Item(m4_shift($@))')')
m4_define(`_Table_Hdr',`_Table_Hdr_Item($@) ')
m4_define(`_Table_Row',`_Table_Row_Item($@) ')
m4_define(`_End_Table',