From owner-freebsd-hackers Fri Jul 21 17:01:44 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id RAA00916 for hackers-outgoing; Fri, 21 Jul 1995 17:01:44 -0700 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id RAA00908 for ; Fri, 21 Jul 1995 17:01:43 -0700 Received: from Eng.Sun.COM by mercury.Sun.COM (Sun.COM) id RAA00646; Fri, 21 Jul 1995 17:00:17 -0700 Received: from plokta.Eng.Sun.COM by Eng.Sun.COM (5.x/SMI-5.3) id AA23611; Fri, 21 Jul 1995 16:59:59 -0700 Received: by plokta.Eng.Sun.COM (5.x/SMI-SVR4) id AA19248; Fri, 21 Jul 1995 17:00:03 -0700 Date: Fri, 21 Jul 1995 17:00:03 -0700 Message-Id: <9507220000.AA19248@plokta.Eng.Sun.COM> From: "Bryan O'Sullivan" To: Ade Barkah Cc: hackers@freebsd.org Subject: Being curious with `cat * > file' In-Reply-To: <199507192022.OAA10037@hemi.com> References: <199507192022.OAA10037@hemi.com> Sender: hackers-owner@freebsd.org Precedence: bulk a> What should `cat * > output` do ? Should it gracefully concatenate a> all the files together into a file called `output', or will it a> attempt to cat the output into itself so many times until the file a> system is filled ? Welcome to the happy world of Unix shell programming ("Semantics? Uh... what that big word mean?"). Whether the filename expansion is performed before or after the output-file-to-be is created depends on the shell you are using and, interestingly enough, not a one of the common shells whose manual pages I checked documented the order in which such things happen. The portable fix: don't try anything like "cat * > output". It's not a FreeBSD problem; it's universal.