Re: cat -v

2006-07-28 Thread Otto Moerbeek
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



Re: cat -v

2006-07-28 Thread Marcus Watts
Nick Guenther [EMAIL PROTECTED] 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 ATT 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



Re: cat -v

2006-07-28 Thread Andreas Kahari

On 28/07/06, Marcus Watts [EMAIL PROTECTED] wrote:

Nick Guenther [EMAIL PROTECTED] 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 ATT 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/online.html



Regards,
Andreas

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



Re: cat -v

2006-07-28 Thread Nick Guenther

On 7/28/06, Otto Moerbeek [EMAIL PROTECTED] 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



Re: cat -v

2006-07-27 Thread Marcus Watts
Nick Guenther [EMAIL PROTECTED] writes:
 Message-ID: [EMAIL PROTECTED]
 Date: Thu, 27 Jul 2006 22:31:10 -0400
 From: Nick Guenther [EMAIL PROTECTED]
 To: OpenBSD-Misc misc@openbsd.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



Re: cat -v

2006-07-27 Thread Nick Guenther

On 7/27/06, Marcus Watts [EMAIL PROTECTED] wrote:

Nick Guenther [EMAIL PROTECTED] writes:
 Message-ID: [EMAIL PROTECTED]
 Date: Thu, 27 Jul 2006 22:31:10 -0400
 From: Nick Guenther [EMAIL PROTECTED]
 To: OpenBSD-Misc misc@openbsd.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



Re: cat -v

2006-07-27 Thread Eric Furman
On Thu, 27 Jul 2006 23:58:49 -0400, Nick Guenther [EMAIL PROTECTED]
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
  [EMAIL PROTECTED]