From owner-freebsd-questions@FreeBSD.ORG Fri Sep 19 03:34:10 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 0DC4916A4B3 for ; Fri, 19 Sep 2003 03:34:10 -0700 (PDT) Received: from ei.bzerk.org (ei.xs4all.nl [213.84.67.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99D6743FDD for ; Fri, 19 Sep 2003 03:34:08 -0700 (PDT) (envelope-from mail25@bzerk.org) Received: from ei.bzerk.org (BOFH@localhost [127.0.0.1]) by ei.bzerk.org (8.12.9p1/8.12.9) with ESMTP id h8JAYYJV011583; Fri, 19 Sep 2003 12:34:34 +0200 (CEST) (envelope-from mail25@bzerk.org) Received: (from bulk@localhost) by ei.bzerk.org (8.12.9p1/8.12.9/Submit) id h8JAYYoc011582; Fri, 19 Sep 2003 12:34:34 +0200 (CEST) X-Authentication-Warning: ei.bzerk.org: bulk set sender to mail25@bzerk.org using -f Date: Fri, 19 Sep 2003 12:34:34 +0200 From: Ruben de Groot To: Karlsson Mikael HKI/SOSV Message-ID: <20030919103434.GA11466@ei.bzerk.org> Mail-Followup-To: Ruben de Groot , Karlsson Mikael HKI/SOSV , freebsd-questions@freebsd.org References: <20030918143306.GF51544@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: freebsd-questions@freebsd.org Subject: Re: Re: Cat a directory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Ruben de Groot List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2003 10:34:10 -0000 On Fri, Sep 19, 2003 at 08:27:00AM +0300, Karlsson Mikael HKI/SOSV typed: > OK! I admit that it isn't THE BIGGEST problem for me BUT it is A problem. What > I ment in my last mail was that it is the biggest problem concerning cat. Since > someone always seems to cat a binary file without having the knowledge of what > it causes. So why don't you for example alias cat to cat -v in your system profile and login scripts? This will display non-printing characters so they are visible and don't mangle terminal settings. > I personally think that some of these tests should be added to the real > distributable version of cat that comes with FreeBSD cause I can't be the only > one that this bugs. I mean what could a little more code hurt to the program > since cat isn't supposed to read binary files. Why not? I regularly use constructs like this: cat somebackup.tgz | ssh someserver "cd /somedir; tar xzf -" > I could add the code myself to cat's source file and compile it so my users > won't be able to cat binary files and stuff like that but what happens to the > thousands of other people that is bugged by the same problem, are they supposed > to do the same re-coding that I did? Or couldn't this simply be added to the > distribution source file so others won't be bugged. > > Other *NIX systems seem to have done this to their cat program so why can't > FreeBSD? and why is this already done to less and not cat? Because less != cat. It has a completely different functionality. Ruben > Dan Nelson wrote (18.9.2003 17:33): > >In the last episode (Sep 18), Karlsson Mikael HKI/SOSV said: > >> What I just wanted to ask was if it's absolutely necessary for cat to > >> be able to work on directories. Or if it would be possible to simply > >> add a check to cat that tests if the "file" being opened is a > >> directory and then exits with an error message if that is the case. > > > >The source is in /usr/src/bin/cat; add some code to stat the file and > >fail if it's a directory. > > > >> The biggest problem for me as a "Unix" help-person at a company is to > >> always explain to newbies and less experienced users not to cat > >> directories as it usually scrambles or locks the whole terminal and > >> as they then turn to me to undo their mistakes. These small simple > >> things give our users bad thoughts about FreeBSD and often drives > >> them to use other OSs! > > > >I find that hard to believe. Do you also want to block catting of > >executables, gzipped files, jpeg files, database files, and audio > >files? No OS does that by default. Maybe you should teach them how to > >reset their terminals when they cat binary data; ^Jreset^J should work, > >assuming your TERM variable is set right. > > > >-- > > Dan Nelson > > dnelson@allantgroup.com > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > -- The world is coming to an end. Please log off.