From owner-freebsd-newbies Fri Jan 8 18:22:23 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA28302 for freebsd-newbies-outgoing; Fri, 8 Jan 1999 18:22:23 -0800 (PST) (envelope-from owner-freebsd-newbies@FreeBSD.ORG) Received: from hecate.webcom.com (hecate.webcom.com [209.1.28.39]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA28297 for ; Fri, 8 Jan 1999 18:22:22 -0800 (PST) (envelope-from graeme@echidna.com) Received: from kigal.webcom.com (kigal.webcom.com [209.1.28.57]) by hecate.webcom.com (8.9.1/8.9.1) with SMTP id SAA13237; Fri, 8 Jan 1999 18:21:45 -0800 Received: from [204.143.69.51] by inanna.webcom.com (WebCom SMTP 1.2.1) with SMTP id 25480002; Fri Jan 08 18:19 PST 1999 Message-Id: <3696BD61.F5@echidna.com> Date: Fri, 08 Jan 1999 21:22:25 -0500 From: Graeme Tait Organization: Echidna X-Mailer: Mozilla 2.02 (Win95; I) Mime-Version: 1.0 To: Malartre Cc: freebsd-newbies@FreeBSD.ORG Subject: Re: The FreeBSD User Guide References: <36958774.8135CE68@aei.ca> <3696183A.1FD5@echidna.com> <3696B0D6.E6975FCD@aei.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Malartre wrote: > > Graeme Tait wrote: > > Certainly "cat filename | more" is redundant: "more filename" is sufficient. > > > > -- > > Graeme Tait - Echidna > Well, you should have seen > http://www.aei.ca/~malartre/freebsd/more1.html > And has K. Marsh said, how could I introduce pipe so simply without the > cat exemple :-) (Please note, I'm not complaining about your user guide - I think it's great! However, the cat example struck a nerve!) There's no need to use cat in a case like that above. I think its best not to give newbies examples they have to unlearn - I've already been down this path with cat, having found a similar example in a standard UNIX text. As a beginner, you get into questions like "well it looks like I could just do 'more filename' but the book says 'cat filename | more' so I guess there must be a good reason for that, so I'll follow the book ... but ???". I would choose a simple case where the pipe is clearly necessary. For example, > ls -l | more to page a file listing of a directory with many files, say /usr/bin . This lets you introduce the pipe and the paging program. The example you give uses cat to transfer the contents of a file to stdout, and pipes that to stdin. AFAIK, since most commands (that can accept input from stdin) can accept input from a single file directly, this application of cat has very limited utility. The true uses I've found for cat are (1) creating short text files directly, as in > cat > file[input text here] ^D and (2) concatenating files, as in > cat file1 file2 > bothfiles -- Graeme Tait - Echidna To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message