Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Sep 2003 08:54:16 -0700
From:      Chris Pressey <cpressey@catseye.mine.nu>
To:        freebsd-questions@freebsd.org
Cc:        mikael.karlsson@hel.fi
Subject:   Re: Cat a directory
Message-ID:  <20030922085416.605aca6b.cpressey@catseye.mine.nu>
In-Reply-To: <JA8AAAAAAgMHPAABYQADV7qgzdhU@master.hel.fi>
References:  <JA8AAAAAAgH8RAABYQADV7qgzdhU@master.hel.fi> <20030919083627.K99065@wonkity.com> <JA8AAAAAAgMHPAABYQADV7qgzdhU@master.hel.fi>

next in thread | previous in thread | raw e-mail | index | archive | help
On 22 Sep 2003 09:06:00 +0300
"Karlsson Mikael HKI/SOSV" <mikael.karlsson@hel.fi> wrote:

> [...]
> Ruben de Groot wrote (19.9.2003  13:34):
> >
> >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.
> 
> So it's better for a newbie to get understandable jibrish from cat
> when run on directories then an error message stating that they are
> trying to run cat on a directory like ls says when they try to run ls
> on a file. But as I said earlier who cares, right? Other OSs have only
> had this for "a couple" of year so why would we!!!

Mikael,

Please understand that FreeBSD is more oriented towards classicists,
luddites, and other sticks-in-the-mud, than propellerhead "early
adopter" users-to-be-friendly-to.  (At least, it used to be; I honestly
have no idea what's going on in 5.x these days.)

Anyway, why not write a script for these users along the lines of:

  #!/usr/bin/perl

  foreach $f (@ARGV)
  {
    if (-d $f) {
      print "cat: $f: is a directory\n";
      exit 1;
    }
  }
  system "cat @ARGV";

Also, I believe 'GNU ls', in the ports, supports coloured directory
listings.

-Chris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030922085416.605aca6b.cpressey>