From owner-freebsd-questions@FreeBSD.ORG Thu Sep 25 08:26:40 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB77E16A4B3 for ; Thu, 25 Sep 2003 08:26:40 -0700 (PDT) Received: from asarian-host.net (mail.asarian-host.net [194.109.160.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 390B943FFD for ; Thu, 25 Sep 2003 08:26:39 -0700 (PDT) (envelope-from admin@asarian-host.net) Comments: To protect the identity of the sender, certain header fields are either not shown, or masked. Anonymous email accounts can be requested by filling in the appropriate form at: https://asarian-host.net/cgi-bin/signup.cgi Received: (from root@localhost) by mail.asarian-host.net (8.12.10/8.12.10) id h8PFQcH9090744 for freebsd-questions@freebsd.org; Thu, 25 Sep 2003 17:26:38 +0200 (CEST) (envelope-from admin@asarian-host.net) From: Mark Message-Id: <200309251526.H8PFQBRP090735@asarian-host.net> Date: Thu, 25 Sep 2003 15:26:38 GMT X-Authenticated-Sender: admin@asarian-host.net X-Trace: Uy3QlcTYneUdzcMnbKKGBvn+zBNiuhJ8aH0oiZNtna6VnIrw3STjZlfFkIP30igpCShM1RJ4oPaXQcUllOhvJA== X-Complaints-To: abuse@asarian-host.net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we are unable to process your complaint Organization: Asarian-host To: References: <200309251421.h8PEL0Gr028335@clunix.cl.msu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Auth: Asarian-host PGP signature iQEVAwUAP3MJLjFqW1BleBN9AQEG7Qf/RM3j39loptW4kpS33M+A705DTlxkMm5/ Yl4u4zCzae1H5xfWCHOO8WqJ/obk8DsU5RrToZXT62U1Vd80Aadpl8zlfb0Z66oh vsE4s9FrULxK+9HsY/badYz3DT5cIgY8ztZBM+L2QRyymAPUTb6BwiM1eTsBSmx1 MTRecxs5M7N3lmhtMtw5fCmzRJ8Mct1s6z5PcR3KriY+S8Jc5u34VEqjw0oYAHdv kFW44JCeB5sj7xp65S9hsDQ2GlKZfir2WhILn5wYPvdPZ2w6rQTpyn3tfE4R76IZ PR1EHMiDplyESd4MYrzKoEPJtLOuQzN6dDAcEtSPrpOiOtGLkxjquw== =65fd Subject: Re: Re:Re: Cat a directory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2003 15:26:41 -0000 ----- Original Message ----- From: "Jerry McAllister" To: "Mark" Cc: Sent: Thursday, September 25, 2003 4:21 PM Subject: Re: Re:Re: Cat a directory But nonetheless very illustrative of how the OS takes into consideration an unexpected, and probably unintended, behavior; namely, unlinking a directory, whereas the user expects it to operate on regular files. Hence, by default, it does NOT unlink directories, and only does so when you specifically add the -d (-r) override. And that, to me, makes perfect sense. Moreover, I feel the same logic should apply to "cat". > If you want a special flag to make cat treat directories specially, > then go ahead and write it and submit it. BUT DO NOT CHANGE THE > DEFAULT BEHAVIOR OF CAT OR YOUR MODIFICATION WILL BE REJECTED BECAUSE IT > WOULD BREAK THOUSANDS OF SCRIPTS AND BE FOOLISH AND UNNECESSARY!!!!!!!! Uh-uh; and no default behavior has ever been changed over the years, eh? :) And what is with these "thousands of scripts" that would suddenly break horribly? So far, I have only heard one good scenario: a specific instance where one would wish to obtain a hex-dump on the actual contents of the directory file; and I even doubt such a use would find its way to a script (as it would probably be a one-time use for debugging/finding lost files or something). In 99.9 percent you will find that "cat" is used on regular files. That figure is actually probably closer to 99.99999 percent; but I'll be mild. When you spell it out like that, what should be "default behavior" becomes clear. > Now, either contribute something or be done with it. I contributed a few clear, well-argumented reasons in favor of my position that "cat" should change its default behavior. You, otoh, have only demonstrated that you are a bully, and that you can yell real loud. Well, that don't impress me much. - Mark