Subject: Re: uugetty for NetBSD
To: None <newsham@aloha.net>
From: Mike Long <mike.long@analog.com>
List: current-users
Date: 10/31/1996 14:31:44
>From: Tim Newsham <newsham@aloha.net>
>Date: Thu, 31 Oct 1996 08:57:21 -1000 (HST)

[I wrote:]
>> I agree with der Mouse that adding argv[0]-sensitive behavior to
>> standard utilities is a bad idea.  Precedent is not an excuse.
>
>I dont know what the big deal is.  First
>symlinks are easy to create.  Second if you have something
>against symlinks, you *can* supply argv[0],
>contrary to what has been said previously.  It doesnt
>take a genius to come up with:
>
[C wrapper]
>
>with such a program you dont have to bother writing
>wrappers to alter the behavior of programs.

No one ever said that you can't frob argv[0].  But as you have
demonstrated, it's impossible to do so without having to use C code
somewhere in the process.  It's additional hair that should not be
necessary.  Do you *really* want an /etc/ttys file that looks like:

console "/usr/libexec/getty Pc" pc3 on secure
tty00 "/usr/local/bin/frob0 /usr/libexec/getty uugetty std.9600" unknown on
tty01 "/usr/local/bin/frob0 /usr/libexec/getty uugetty std.9600" unknown on
ttyp0 none network off
ttyp1 none network off
...

Usually the polymorphic utility is already using getopt(3), so all you
need to do is add another flag:  One more character in a string, and
one more case clause in a switch().  That's *much* more efficient than
any wrapper that you could create.
-- 
Mike Long <mike.long@analog.com>     <URL:http://www.shore.net/~mikel>
VLSI Design Engineer         finger mikel@shore.net for PGP public key
Analog Devices, CPD Division          CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA       (eq (opinion 'ADI) (opinion 'mike)) -> nil