Thread View: comp.bugs.sys5
11 messages
11 total messages
Started by treingol
Wed, 09 Jan 1991 16:06
small bug in who(1) of SVR3
Author: treingol
Date: Wed, 09 Jan 1991 16:06
Date: Wed, 09 Jan 1991 16:06
22 lines
1502 bytes
1502 bytes
The System V systems I use run releases 3.1 and 3.2. They allow you to type "who -Hq" which doesn't really make sense. The 'H' flag is to print a header for the normal "who" output, and the 'q' flag is to change the output to use multiple columns. So the output of "who -Hq" looks like this; the header line is meaningless. NAME LINE TIME cgf denisede ayoung jjschuld oneillv eah dgeorge mhratko jportlan vbt mschuld fishere cgarbows ghager ehornich dave jadler cg rbalko kmccarth robbo gchung kfriedma ecronin mferguso gwm bonnieb jpittas wai raturner kr cvourtsi egoon seema mm patt rjones tchapman mreddy dandriol acs kch treingol # users=43 Is the SVR4 who command derived from BSD or SVR3? Tom Reingold AT&T att!journey!treingold Juniper Plaza, Route 9 treingold@journey.att.com Room 1A-133 (908) 577-5814 [work] Freehold, NJ 07728-3298 (908) 287-2345 [home]
Re: small bug in who(1) of SVR3
Author: Paul S. Sawyer
Date: Thu, 10 Jan 1991 13:07
Date: Thu, 10 Jan 1991 13:07
31 lines
1809 bytes
1809 bytes
In article <9101091725.AA15013@ucbvax.Berkeley.EDU> treingol@journey.att.com writes:
>The System V systems I use run releases 3.1 and 3.2. They allow you to
>type "who -Hq" which doesn't really make sense. The 'H' flag is to
>print a header for the normal "who" output, and the 'q' flag is to
>change the output to use multiple columns. So the output of "who -Hq"
>looks like this; the header line is meaningless.
>
>NAME LINE TIME
>cgf denisede ayoung jjschuld oneillv eah dgeorge mhratko
>jportlan vbt mschuld fishere cgarbows ghager ehornich dave
>jadler cg rbalko kmccarth robbo gchung kfriedma ecronin
>mferguso gwm bonnieb jpittas wai raturner kr cvourtsi
>egoon seema mm patt rjones tchapman mreddy dandriol
>acs kch treingol
># users=43
$ who -Hq
argos jed lookout paul paul root
# users=6
$ uname -rvm
2.1.2 1 3B15
From TFM (for who -q): ".... When this option is used, all other options
are ignored."
One of the few rewards for running a dinosaur? B-)
--
Paul S. Sawyer {uunet,attmail}!unhtel!paul paul@unhtel.uucp
UNH CIS - - Telecommunications and Network Services pss@unhd.unh.edu
Durham, NH 03824-3523 VOX: +1 603 862 3262 FAX: +1 603 862 2030
Re: small bug in who(1) of SVR3
Author: Doug Gwyn
Date: Fri, 11 Jan 1991 21:57
Date: Fri, 11 Jan 1991 21:57
10 lines
913 bytes
913 bytes
In article <1991Jan10.130738.10194@unhtel.uucp> paul@unhtel.uucp (Paul S. Sawyer) writes: >$ who -Hq >argos jed lookout paul paul root ># users=6 Of course the actual bug is that "who" has no business being designed this way. If you want columnation, it is trivial (who|6, for example), as is a user count (who|wc). Building such functionality into the "who" command is so much against UNIX design principles that I have to wonder who could have approved such features.
Re: small bug in who(1) of SVR3
Author: Jay Maynard
Date: Sat, 12 Jan 1991 00:42
Date: Sat, 12 Jan 1991 00:42
17 lines
1527 bytes
1527 bytes
In article <14818@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes:
>Of course the actual bug is that "who" has no business being designed
>this way. If you want columnation, it is trivial (who|6, for example),
>as is a user count (who|wc). Building such functionality into the
>"who" command is so much against UNIX design principles that I have to
>wonder who could have approved such features.
The same guy who approved turning ls into the feeping creature that it is
today, of course...and other stuff, as well.
(Why does Berzerkeley ls have to act the way it does? Yuk. Having to say ls
if the destination is a terminal, but ls -C if I want to pipe into, say,
is nonintuitive at best.)
--
Jay Maynard, EMT-P, K5ZC, PP-ASEL | Never ascribe to malice that which can
jmaynard@thesis1.hsch.utexas.edu | adequately be explained by stupidity.
"I smell a scientific fish." -- Chip Salzenberg
Re: small bug in who(1) of SVR3
Author: John F Haugh II
Date: Sat, 12 Jan 1991 18:48
Date: Sat, 12 Jan 1991 18:48
27 lines
2159 bytes
2159 bytes
In article <14818@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes: >Of course the actual bug is that "who" has no business being designed >this way. If you want columnation, it is trivial (who|6, for example), >as is a user count (who|wc). Building such functionality into the >"who" command is so much against UNIX design principles that I have to >wonder who could have approved such features. This makes the assumption that the initial design of "who" was perfect in the first place. It is clear (to me, at least) that an unadorned "who" should tell you exactly what it does. However, there are sufficient reasons for more or less information to be given. Why should I be forced to 1) write a new command (ala "users") or 2) use pipes (ala "who | cut -d' ' -f1 | pr -6 -l1) to get the same results as "who -q"? The real problem comes in when the information is presented in a form that requires special processing to be useful, as does the output of "who -q". That last line serves little use when contrasted against the purpose of the who command, which is "Lists who is on the system". Perhaps Doug is right - perhaps one command should have one narrowly defined purpose. On the other hand, what is preventing "users" from being a simple link to "who -q"? -- 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."
Re: small bug in who(1) of SVR3
Author: Henry Spencer
Date: Sun, 13 Jan 1991 00:48
Date: Sun, 13 Jan 1991 00:48
17 lines
1386 bytes
1386 bytes
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? 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". 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. -- If the Space Shuttle was the answer, | Henry Spencer at U of Toronto Zoology what was the question? | henry@zoo.toronto.edu utzoo!henry
Re: small bug in who(1) of SVR3
Author: Robert Elz
Date: Sun, 13 Jan 1991 17:41
Date: Sun, 13 Jan 1991 17:41
23 lines
1701 bytes
1701 bytes
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' .... >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". This is sheer religious fervour taken to extremes ... the simply fact is that "who" is one of the most baroque commands in unix, if it had originally been more like (say) "ls", where "who" gave a simple list of users, and "who -l" gave similar output to the traditional "who", no-one would even think of complaining about it - but because it wasn't originally done that way, it's apparently heresy to suggest that anything be changed. Now I've never seen a "who" with a "-q" option, so I can't comment on how well the change was thought out (comments here make me suspect not well at all, but that's hearsay only), but the question of whether a change should be made at all is simply not suitably answered by "never". kre
Re: small bug in who(1) of SVR3
Author: John F Haugh II
Date: Sun, 13 Jan 1991 20:45
Date: Sun, 13 Jan 1991 20:45
47 lines
3258 bytes
3258 bytes
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."
Re: small bug in who(1) of SVR3
Author: Henry Spencer
Date: Mon, 14 Jan 1991 20:20
Date: Mon, 14 Jan 1991 20:20
28 lines
1954 bytes
1954 bytes
In article <18899@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes: >>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"? Add up the costs of writing the C code, the costs of maintaining it, the costs of enhancing it to add the next round of silly "features", and so forth. Now consider how many times per second "who" gets run, and how critical its performance is -- i.e., not very many and not very. The optimization is not worth the price. >... fork() and exec() are neither free nor even cheap - shell >scripts are just not the right answer. Odd; we've found that shell scripts are the right answer for an enormous range of applications. "ls" is a shell script on utzoo (it invokes the Sun ls with the -1 option). The question is not whether fork() and exec() are free -- obviously not -- or cheap -- thanks to manufacturer stupidity and greed, often they aren't -- but whether they are cheap *enough*. The answer is usually "yes". Incidentally, it turns out that one can often rewrite Berkeley or AT&T C programs as shell files and find that they run *faster*. -- If the Space Shuttle was the answer, | Henry Spencer at U of Toronto Zoology what was the question? | henry@zoo.toronto.edu utzoo!henry
Re: small bug in who(1) of SVR3
Author: Greg A. Woods
Date: Tue, 15 Jan 1991 18:59
Date: Tue, 15 Jan 1991 18:59
35 lines
2522 bytes
2522 bytes
In article <18899@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes:
> 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"?
To follow up on what Geoff already said, one should also note the cost
of a C programmer far exceeds even the accumulated cost of the few
seconds it takes every user to get the exact output he or she wants
each time by typing a short script, and the extra milliseconds
required to execute the script. BTW, the original script was somewhat
simpler than the ugly SysV example given above. Besides, the user who
learns to use tools will save ever so much more time in the future.
Yes, lots of thought, or should I say experience, needs to go into
defining the set of available tools and their options. One thing
which makes me mad is the way vendors blindly grab the source from
AT&T, compile it, and sell it. What ever happened to the feedback
channel to AT&T? Why aren't the good things in Research UNIX getting
out? Maybe this is why people blindly fall in love with BSD.
However, don't, especially in this day and age, equate "simple and
cheap" with "the least amount of memory and CPU". We have to have a
reasonable balance, sure.
--
Greg A. Woods
woods@{eci386,gate,robohack,ontmoh,tmsoft}.UUCP ECI and UniForum Canada
+1-416-443-1734 [h] +1-416-595-5425 [w] VE3TCP Toronto, Ontario CANADA
Political speech and writing are largely the defense of the indefensible-ORWELL
Re: small bug in who(1) of SVR3
Author: Carmen Hardina
Date: Sun, 20 Jan 1991 19:11
Date: Sun, 20 Jan 1991 19:11
41 lines
2189 bytes
2189 bytes
In article <9101091725.AA15013@ucbvax.Berkeley.EDU> treingol@journey.att.com (Tom Reingold) writes: >The System V systems I use run releases 3.1 and 3.2. They allow you to >type "who -Hq" which doesn't really make sense. The 'H' flag is to >print a header for the normal "who" output, and the 'q' flag is to >change the output to use multiple columns. So the output of "who -Hq" >looks like this; the header line is meaningless. > >NAME LINE TIME >cgf denisede ayoung jjschuld oneillv eah dgeorge mhratko >jportlan vbt mschuld fishere cgarbows ghager ehornich dave >jadler cg rbalko kmccarth robbo gchung kfriedma ecronin >mferguso gwm bonnieb jpittas wai raturner kr cvourtsi >egoon seema mm patt rjones tchapman mreddy dandriol >acs kch treingol ># users=43 > >Is the SVR4 who command derived from BSD or SVR3? > >Tom Reingold [....] Under SCO XENIX System V, a "who -Hq" produces the following output. carmen carmen carmen # users=3 I don't know about SVR4, but I do belive that the XENIX binary is derived from SVR2 source. It's a bug in the code, not functionality. If the q option worked properly, the ability to also specify the H option (or any other, for that matter) would "make sense". The XENIX man page states the following. -q This is a quick who, displaying only the names and the number of users currently logged on. When this option is used, all other options are ignored. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Which vendors port of SVR3 are you using? --Carmen
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads