Path: utzoo!utgpu!watserv1!watmath!att!rutgers!uwm.edu!cs.utexas.edu!execu!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F Haugh II) Newsgroups: comp.bugs.sys5 Subject: Re: small bug in who(1) of SVR3 Message-ID: <18899@rpp386.cactus.org> Date: 13 Jan 91 20:45:11 GMT References: <9101091725.AA15013@ucbvax.Berkeley.EDU> <1991Jan10.130738.10194@unhtel.uucp> <14818@smoke.brl.mil> <18896@rpp386.cactus.org> <1991Jan13.004843.18650@zoo.toronto.edu> Reply-To: jfh@rpp386.cactus.org (John F Haugh II) Organization: Lone Star Cafe and BBS Service Lines: 47 X-Clever-Slogan: Recycle or Die. In article <1991Jan13.004843.18650@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >In article <18896@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes: >>... Why should I be forced to... use pipes (ala "who | >>cut -d' ' -f1 | pr -6 -l1) to get the same results as "who -q"? > >Because they are the simplest and cheapest way to get the desired results? How can you possibly say that? The amount of machine overhead in the above case is several times greater than "who -q". In which sense is it "the simplest and cheapest way"? >I don't care how easy it was to add the "-q" option, it was a waste of the >programmer's time. A shell program using pipes could have been written in >seconds, solving the problem without messing around with "who". Sure, I managed to write that little blurb in about 5 seconds. Most of that time was spent considering if I wanted to sort the list (ala BSD "users" command) or not. However, once you add yet another program you have to add all of the support that goes into having yet another file to hold the source, yet another file to hold the documentation, yet another file to hold any test cases, etc. >There seems to be a pervasive delusion that the only two ways things can >be done are (a) add every conceivable option to the C program or (b) force >the user to type long sequences using pipes. The correct approach, when >such functionality is often used, is to package it up in a system-supplied >shell file. Straw man. No one is suggesting that "every conceivable option" be added to the "who" command. Given that BSD provides "users" and System V provides "who -q", there is clearly a desire to have the functionality described. Adding the second command ("users") only increases the amount of code which must be maintained with no resultant benefits in usablity or performance. fork() and exec() are neither free nor even cheap - shell scripts are just not the right answer. The "-q" option involves a very small code change and an additional paragraph on a manpage which already has the heading "Lists who is on the system". The BSD manpage begins "compact list of users who are on the system". Which is clearer? Two commands on two different pages, or one command with one additional option? -- John F. Haugh II UUCP: ...!cs.utexas.edu!rpp386!jfh Ma Bell: (512) 832-8832 Domain: jfh@rpp386.cactus.org "While you are here, your wives and girlfriends are dating handsome American movie and TV stars. Stars like Tom Selleck, Bruce Willis, and Bart Simpson."