Date: Fri, 08 Jan 1999 13:15:29 -0500 From: Graeme Tait <graeme@echidna.com> To: "K. Marsh" <durang@u.washington.edu> Cc: freebsd-newbies@FreeBSD.ORG Subject: Re: The FreeBSD User Guide Message-ID: <36964B41.742B@echidna.com> References: <Pine.A41.4.05.9901080925450.125176-100000@goodall1.u.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
K. Marsh wrote: > > On Fri, 8 Jan 1999, Graeme Tait wrote: > > > One specific comment - you suggest "cat" for printing files to the screen, > > as does at least one Unix book I have. > > > > I started off using "cat" as a raw beginner as that was what I was "told". > > Then someone was roasted on this list for using "cat" for this purpose, and > > ever since I've used the suggested "more" or "less". It was not explained in > > detail why "cat" was inappropriate, although one issue seemed to be with > > listing files with arbitrary content. > > I don't know why anybody would roast someone for using "cat" on a newbie > list, but more is certainly more preferable, because if the whole file > fits on a screen, it's output is the same as that of cat, and if it > doesn't fit on a screen, then cat's doing work that doesn't provide any > benefit - because it rolls off the screen before you can read it. Also, > more has a search feature - by type in a "/string" you can search the > document for the next occurance of "string". This is very useful. Actually, I didn't realize this was "newbies" - the post I referred to was I think on questions, although I've been unable to find it with a search of the archives. "cat" and "more" or "less" are not the same when processing non-printing characters to the screen. "cat" as I understand it sends non-printing characters literally to the screen, "more" and "less" replace them with printing versions. I got the impression from the post I mentioned that sending non-printing characters to the screen might get you into trouble. Certainly, I've had it do strange things to a telnet session. > I'm willing to bet, however, that many books written for beginners suggest > using cat because cat is one of the most fundamental commands available in > UNIX, and a new user should learn to be proficient with cat before they > learn more. Also, more is less valuable when working with other > begginner's commands, like tar and sort, pipes, and file redirection. Yes, cat has its place - but what the poster claimed was that place did not include outputting files to the screen (as a matter of habit), and that newbies should not be educated to use it that way. I'm just repeating (my paraphrase from memory) of what the post said - I'd be interest in hearing any comments on the above. -- Graeme Tait - Echidna To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36964B41.742B>