From owner-freebsd-newbies Fri Jan 8 10:15:28 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA00812 for freebsd-newbies-outgoing; Fri, 8 Jan 1999 10:15:28 -0800 (PST) (envelope-from owner-freebsd-newbies@FreeBSD.ORG) Received: from hera.webcom.com (hera.webcom.com [209.1.28.42]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA00798 for ; Fri, 8 Jan 1999 10:15:25 -0800 (PST) (envelope-from graeme@echidna.com) Received: from eresh.webcom.com (eresh.webcom.com [209.1.28.49]) by hera.webcom.com (8.9.1/8.9.1) with SMTP id KAA02413; Fri, 8 Jan 1999 10:14:45 -0800 Received: from [204.143.69.51] by inanna.webcom.com (WebCom SMTP 1.2.1) with SMTP id 25289175; Fri Jan 08 10:12 PST 1999 Message-Id: <36964B41.742B@echidna.com> Date: Fri, 08 Jan 1999 13:15:29 -0500 From: Graeme Tait Organization: Echidna X-Mailer: Mozilla 2.02 (Win95; I) Mime-Version: 1.0 To: "K. Marsh" Cc: freebsd-newbies@FreeBSD.ORG Subject: Re: The FreeBSD User Guide References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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