Subject: Re: sysv ps(1) implementation [was: ps(1) sysv silliness]
To: Andrew Brown <atatat@atatdot.net>
From: Greywolf <greywolf@starwolf.com>
List: tech-userlevel
Date: 06/08/2000 13:07:01
On Thu, 8 Jun 2000, Andrew Brown wrote:

# >>sendmail/mailq/hoststat/...
# >>chown/chgrp
# >>ex/vi/view
# >>cksum/md5/sum
# >>hexdump/od
# >>quotaon/quotaoff
# >>chfn/chpass/chsh
# >>passwd/yppasswd
# >>less/more/page
# >>...
# >>ramdiskbin/cp/ln/mv/sh/init/...
# 
# jhawk>I think most of the above are in fact Bad Ideas(tm), but
# jhawk> ramdiskbin is a special case.

As Andrew pointed out...

# it's mostly a case of programs that have very similar functionality
# changing behavior based on argv[0] instead of having separate
# binaries.  it saves on disk space.

...and load time after the first time you load one of them.

[historical note:  mv/cp/ln/rm (I forget which three of them) were
 hard links at one point; and I seem to remember (erroneously) perhaps
 mkdir being linked to mknod (prior to mkdir(2) being implemented...)]

# jhawk>Users should be able to copy binaries around
# jhawk>and rename them as they see fit without seeing
# jhawk>strange lossage or behavior changes.

...why?  Why do we want our users to be able to copy around system binaries
and rename them?  USERS have no business, really, doing so.  That's why
shells have aliases and/or shell functions.

# jhawk>While it's acceptable to grandfather in this sort of thing
# jhawk>because it has been there forever, adding new instances of it
# jhawk>should be forbidden.
#
# andrew>while it's acceptable to do cool things, you should cease from doing
# andrew>new cool things.
# 
# jhawk>I don't think that parsing __progname is a "cool thing,"
# jhawk>it's a "hokey broken thing that causes problem." Any new cool
# jhawk>things can be acheived by either using command line switches or
# jhawk>installing seperate binaries.

Separate binaries.  Yeah.  John, there is no justification for not
conserving resources even when you have more than enough to go around,
unless doing so severely impacts performance (then you have separate
binaries).

In the above cases, it makes a LOT of sense to have the hooks
in a single binary, otherwise code is duplicated, space is wasted,
cache is lost (if you think cache isn't important, you have never had
to run a shell script which did a lot of chown/chgrp and other linked-
binary stuff on a BIG tree or a lot of files, and you had the script
handy but no time to write another one).

# imho, having to specify "grep -G", "grep -E", or "grep -F" is a pain.
# grep means grep, egrep means egrep, and fgrep means fgrep, without me
# having to tell it so.

Concur.

# on the other hand, i also don't think that having multiple programs
# that do somewhat the same thing is a good idea.  i've got too many
# versions of sh, ls, ln, and ld on solaris to make me happy, and they
# all behave differently.

That's the other extreme from multiple links -- multiple instances.

				--*greywolf;
--
BSD:  For IQs higher than 120.