From owner-freebsd-questions@FreeBSD.ORG Thu Sep 25 08:29:44 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 BB3E916A4B3 for ; Thu, 25 Sep 2003 08:29:44 -0700 (PDT) Received: from asarian-host.net (mail.asarian-host.net [194.109.160.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id B85E444035 for ; Thu, 25 Sep 2003 08:29:40 -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 h8PFTee7090888 for freebsd-questions@freebsd.org; Thu, 25 Sep 2003 17:29:40 +0200 (CEST) (envelope-from admin@asarian-host.net) From: Mark Message-Id: <200309251529.H8PFTDRP090879@asarian-host.net> Date: Thu, 25 Sep 2003 15:29:39 GMT X-Authenticated-Sender: admin@asarian-host.net X-Trace: 1rgJGh8BbhYEI9iGH6V6jvS+TxgTJwD+9hxcy5l+hmmCrHWC9BWk0rZ+t7RDUxHi82YQvLD8Yl2lesY4sM56Bw== 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 iQEVAwUAP3MJ5DFqW1BleBN9AQFnSQgAi/9mdEj6lp6KA1jjJJVajOyzGyrg/LTI nzAydDhDiv/Yq19XUoJEHDsznXvTXElxTLK/r9sw3WiB7rnyMJa1pkjn7cv0RImh XamZMPZpAktfeJ/ES5tM6JfFtTCDWWiQhvwSWwoQ1PxIm636TDMJImb/aEsE341U wAVHFdeQe+kRP5zZD8knQnbIby3v0F0EJm0p8VmZsGy5rECOebiSIE544wghs37o d8jOslKGyB+mbPoaFyOQEj0gJp8O0celZjYZOkL2m7Z0Mrk/fHD9t+0O6qij2ENM SRjyi7/uZW+TBUiPyu7WoF7H+2qSiQI0t68YibdBYSGsNgxm3+2cvA== =geob 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:29:44 -0000 [it seems I forgot a paragraph] ----- Original Message ----- From: "Jerry McAllister" To: "Mark" Cc: Sent: Thursday, September 25, 2003 4:21 PM Subject: Re: Re:Re: Cat a directory > > I would like to see a switch added to cat, like "-d", which specifically > > allows it to operate on directories too, for that once-in-a-million > > chance I actually need a hex dump on the directory as file. In fact, > > that behavior is already incorporated in the "rm" command: > > Again, rm is something very different. 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 allowed to call itself "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