List Info

Thread: cat -v




cat -v
user name
2006-07-28 02:31:10
Why does cat retain the -[etv], -[bn] and -[s] options? I am
reading
the paper cited in cat's manpage and saw 'vis' mentioned.
vis is in
base, and line numbering and stripping can be done with sed,
so why
does cat have those options? Is for history, just for
compatibility,
or has no one ever bothered to remove them (I find this
unlikely)?

-Nick

cat -v
user name
2006-07-28 03:04:47
"Nick Guenther" <kousuegmail.com> writes:
> Message-ID:
<98f5a8830607271931k4b1024c9t21a7708ad7e5766dmail.gmail.com>
> Date: Thu, 27 Jul 2006 22:31:10 -0400
> From: "Nick Guenther" <kousuegmail.com>
> To: OpenBSD-Misc <miscopenbsd.org>
> Subject: cat -v
> 
> Why does cat retain the -[etv], -[bn] and -[s] options?
I am reading
> the paper cited in cat's manpage and saw 'vis'
mentioned. vis is in
> base, and line numbering and stripping can be done with
sed, so why
> does cat have those options? Is for history, just for
compatibility,
> or has no one ever bothered to remove them (I find this
unlikely)?
> 
> -Nick

Using the same argument, everything that grep, sed and awk
can do can be
done in perl, so why have grep, sed & awk?  All we need
to do is teach
everybody to type "perl -pe 1" in place of
"cat".

			-Marcus Watts

cat -v
user name
2006-07-28 03:58:49
On 7/27/06, Marcus Watts <mdwumich.edu> wrote:
> "Nick Guenther" <kousuegmail.com> writes:
> > Message-ID:
<98f5a8830607271931k4b1024c9t21a7708ad7e5766dmail.gmail.com>
> > Date: Thu, 27 Jul 2006 22:31:10 -0400
> > From: "Nick Guenther" <kousuegmail.com>
> > To: OpenBSD-Misc <miscopenbsd.org>
> > Subject: cat -v
> >
> > Why does cat retain the -[etv], -[bn] and -[s]
options? I am reading
> > the paper cited in cat's manpage and saw 'vis'
mentioned. vis is in
> > base, and line numbering and stripping can be done
with sed, so why
> > does cat have those options? Is for history, just
for compatibility,
> > or has no one ever bothered to remove them (I find
this unlikely)?
> >
> > -Nick
>
> Using the same argument, everything that grep, sed and
awk can do can be
> done in perl, so why have grep, sed & awk?

I have been wondering that too somewhat, but I assume it is
because
they have different uses and they are easier to use than
doing a perl
script every time.

> All we need to do is teach
> everybody to type "perl -pe 1" in place of
"cat".

That's not the same as what I was asking. "perl -pe
1" is more complex
(in typing and implementation) than "cat",
wheras "cat -v" is more
complex than "vis".

Anyway, I wasn't trying to fight about it, I'm just
curious.

-Nick

cat -v
user name
2006-07-28 05:49:42
On Thu, 27 Jul 2006 23:58:49 -0400, "Nick
Guenther" <kousuegmail.com>
said:
> > > Why does cat retain the -[etv], -[bn] and
-[s] options? I am reading
> > > the paper cited in cat's manpage and saw
'vis' mentioned. vis is in
> > > base, and line numbering and stripping can be
done with sed, so why
> > > does cat have those options? Is for history,
just for compatibility,
> > > or has no one ever bothered to remove them (I
find this unlikely)?
> > >
> > > -Nick
> >
> > Using the same argument, everything that grep, sed
and awk can do can be
> > done in perl, so why have grep, sed & awk?
> 
> I have been wondering that too somewhat, but I assume
it is because
> they have different uses and they are easier to use
than doing a perl
> script every time.
> 
> > All we need to do is teach
> > everybody to type "perl -pe 1" in
place of "cat".
> 
> That's not the same as what I was asking. "perl
-pe 1" is more complex
> (in typing and implementation) than "cat",
wheras "cat -v" is more
> complex than "vis".
> 
> Anyway, I wasn't trying to fight about it, I'm just
curious.

You haven't heard the term Creeping featurism? It is the
desire of
UNIX hackers to add every functionality to a command until
you
can even send mail with it.
The -exec option to find is the most classic example of
this.
With that option, using find, you can do 'anything'. 
Up to and including rebooting...
-- 
  Eric Furman
  ericfurmanfastmail.net

cat -v
user name
2006-07-28 06:13:26
On Thu, 27 Jul 2006, Nick Guenther wrote:

> Why does cat retain the -[etv], -[bn] and -[s] options?
I am reading
> the paper cited in cat's manpage and saw 'vis'
mentioned. vis is in
> base, and line numbering and stripping can be done with
sed, so why
> does cat have those options? Is for history, just for
compatibility,
> or has no one ever bothered to remove them (I find this
unlikely)?

Once you've added a flag to a command it's almost
impossible to remove it
for compatibility reasons.

	-Otto

cat -v
user name
2006-07-28 09:19:59
"Nick Guenther" <kousuegmail.com> writes:
...
> Anyway, I wasn't trying to fight about it, I'm just
curious.
...

"sed -n l" has been around since
"forever" or at least since v7.
Presumably before that folks used "ed" or
"od".

cat -v -e etc. have been around in *bsd since at least
4.1bsd.
I don't remember AT&T picking up on those options, but
probably -v, -e, etc., are part of various standards today.
Certainly the FSF folks picked up on those flags in their
"GNU core utilities".

The "vis" command appears to have been added in
4.4bsd.
I can't find any evidence of "vis" outside of
4.4bsd.

Most people who've been around Unix long enough have their
own pet
commands.  For instance, I have "randomize",
"fd", and "genpass".  I
use randomize all the time to unsort data line by line
differently each
time, fd in place of "od -xc" to get
side-by-side hex & ascii dump
output, and more rarely genpass to generate random passwords
for
things.  There's very probably some population of other
people out
there who might find those very commands useful, - but it's
also very
probable there's not a large enough population of such
users that I
could find them without annoying a bunch of other people in
the
process.

				-Marcus Watts

cat -v
user name
2006-07-28 09:38:42
On 28/07/06, Marcus Watts <mdwumich.edu> wrote:
> "Nick Guenther" <kousuegmail.com> writes:
> ...
> > Anyway, I wasn't trying to fight about it, I'm
just curious.
> ...
>
> "sed -n l" has been around since
"forever" or at least since v7.
> Presumably before that folks used "ed" or
"od".
>
> cat -v -e etc. have been around in *bsd since at least
4.1bsd.
> I don't remember AT&T picking up on those options,
but
> probably -v, -e, etc., are part of various standards
today.
> Certainly the FSF folks picked up on those flags in
their
> "GNU core utilities".

The only standard (SUSv3) switch for the cat utility is
"-u" for
unbuffered output.

The -e, -t, -v, -s, and -n switches are mentioned in the
rationale,
and the reason for not having them in the standard is that
the same
functionality may be found in other utilities (giving
examples using
sed(1) and pr(1)).

http://www.unix.org/o
nline.html



Regards,
Andreas

-- 
Andreas Kahari
Somewhere in the general Cambridge area, UK

cat -v
user name
2006-07-28 13:23:05
On 7/28/06, Otto Moerbeek <ottodrijf.net> wrote:
>
> On Thu, 27 Jul 2006, Nick Guenther wrote:
>
> > Why does cat retain the -[etv], -[bn] and -[s]
options?
>
> Once you've added a flag to a command it's almost
impossible to remove it
> for compatibility reasons.

Thanks Otto. That's what I figured but I was thinking that
the OpenBSD
philosophy would trump compatibility.

-Nick

[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )