home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v1 < prev    next >
Internet Message Format  |  1987-06-30  |  172KB

  1. From jsq@ut-sally.UUCP Tue Jun 25 23:16:34 GMT 1985
  2. Path: ut-sally!jsq@ut-sally.UUCP (John Quarterman)
  3. From: jsq@ut-sally.UUCP (John Quarterman)
  4. Newsgroups: mod.std.unix
  5. Subject: mod.std.unix created
  6. Message-ID: <2189@ut-sally.UUCP>
  7. Date: 25 Jun 85 23:16:34 GMT
  8. Sender: jsq@ut-sally.UUCP
  9. Organization: U. Texas CS Dept., Austin, Texas
  10. Lines: 34
  11. Approved: jsq@ut-sally.UUCP
  12. Draft-9: mod.std.unix
  13.  
  14. This moderated newsgroup, mod.std.unix, is for discussions of UNIX
  15. standards, in particular the one in progress by the IEEE P1003 "UNIX
  16. Standards" committee.  P1003 is the successor to the /usr/group
  17. standards committee, and many of the members are the same.
  18.  
  19. The newsgroup moderator is me, John Quarterman.  I got into this
  20. because the USENIX board appointed me to be the USENIX delegate
  21. to P1003.  My function is largely to relay information between
  22. the committee and the USENIX board and membership (I also vote
  23. for USENIX in cases where that is appropriate).  The committee
  24. considers this newsgroup to be one good way to do that.  I will
  25. report on the contents of the newsgroup to the committee, for the
  26. benefit of those who do not follow the newsgroup directly.
  27.  
  28. While various P1003 committee members will probably post things
  29. to mod.std.unix, it is best to assume that such postings are
  30. personal opinions of the poster, not the official position of
  31. the committee, nor even of the poster's company, unless it is
  32. specifically stated otherwise.
  33.  
  34. To start with, the newsgroup will go out as individual articles.
  35. If volume builds, I will probably change to a digest format,
  36. so that discussions can be grouped together.
  37.  
  38. Please mail submissions for mod.std.unix to ihnp4!ut-sally!std-unix,
  39. and comments about the newsgroup to ihnp4!ut-sally!std-unix-request.
  40. (The ARPA Internet addresses, e.g., std-unix@ut-sally.ARPA, also work.)
  41. Mail to my personal mail address (below) will be treated as not
  42. for posting, though I may reply with a request for permission to post.
  43.  
  44. -- 
  45. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  46.  
  47. Volume-Number: Volume 1, Number 01
  48.  
  49. From jsq@ut-sally.UUCP Fri Jun 27 15:58:07 GMT 1985
  50. Path: ut-sally!jsq
  51. From: jsq@ut-sally.UUCP (John Quarterman)
  52. Newsgroups: mod.std.unix
  53. Subject: command line arguments
  54. Message-ID: <2210@ut-sally.UUCP>
  55. Date: 28 Jun 85 15:58:07 GMT
  56. Organization: U. Texas CS Dept., Austin, Texas
  57. Lines: 29
  58. Approved: jsq@ut-sally.UUCP
  59. In-Reply-To: <2189@ut-sally.UUCP>
  60. Draft-9: 1003.2.getopt
  61.  
  62. some commands take arguments as
  63.  
  64. command -abcdefg filename
  65.  
  66. and some as
  67.  
  68. command -a -b -c -d -e -f -g filename
  69.  
  70. It would be great if this was standardised.
  71. Post this if you like: it's gleaned from a book 'Unix for beginners' by
  72. Miller and Boyle at the University of Leeds, UK
  73. -- 
  74.  'He had a certain naive charm, but no muscle!'
  75.                      Frank N. Furter in the Rocky Horror Picture Show.
  76.  
  77. +-------------------------+------------------------------------------+
  78. | Douglas Spencer         | {decvax,garfield,okstate,philabs,seismo} |
  79. |  Maths Institute        |      !mcvax!ukc!warwick!daisy!maugg      |
  80. |   University of Warwick |------------------------------------------|
  81. |    Coventry CV4 7AL     | If necessary I can also be contacted     |
  82. |     England             | easily by any competent telepath     :-) |
  83. +-------------------------+------------------------------------------+
  84.  
  85. [ The P1003 draft standard has little to say about commands, as it's
  86. mostly concerned with system calls and library routines.  Varying option
  87. formats are a nuisance, though.  -mod]
  88. -- 
  89.  
  90. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  91.  
  92. Volume-Number: Volume 1, Number 02
  93.  
  94. From jsq@ut-sally.UUCP Sun Jun 30 02:52:52 GMT 1985
  95. Path: ut-sally!jsq
  96. From: jsq@ut-sally.UUCP (John Quarterman)
  97. Newsgroups: mod.std.unix
  98. Subject: Re: command line arguments
  99. Message-ID: <2220@ut-sally.UUCP>
  100. Date: 30 Jun 85 02:52:52 GMT
  101. Reply-To: cyb-eng!bc
  102. Organization: U. Texas CS Dept., Austin, Texas
  103. Lines: 42
  104. Approved: jsq@ut-sally.UUCP
  105. In-Reply-To: your article <2210@ut-sally.UUCP>
  106. Draft-9: 1003.2.getopt
  107.  
  108. > some commands take arguments as
  109. > command -abcdefg filename
  110. > and some as
  111. > command -a -b -c -d -e -f -g filename
  112. > It would be great if this was standardised.
  113.  
  114. Although commands like find will, I suppose always be renegades, doesn't
  115. conformity to getopt() for all future commands not explicitly excused from
  116. conformity by some ANSI committee take care of the problem?  It seems that
  117. this is (or at least SHOULD be) simply a problem of living with history.
  118.  
  119. By the way, I understand that the central concern of the committee is in
  120. the area of system calls, but aren't y'all going to have a subcommittee
  121. responsible for commands, shells, etc analogous to the C committee's
  122. "library" subcommittee?  I would hope so.
  123.  
  124. [ Would some more knowledgable P1003 committee member please comment
  125. on this?  -mod]
  126.  
  127. If this kind of stuff should be sent to ut-sally!std-unix instead of
  128. ut-sally!jsq, let me know.
  129.  
  130. [ The convention I have adopted is that mail to ut-sally!std-unix
  131. is a submission to the newsgroup, while mail to ut-sally!jsq (or,
  132. better, ut-sally!std-unix-request) is mail about the newsgroup,
  133. though I may, as I did for this message, reply with a request
  134. for permission to post.  -mod]
  135.  
  136. bc
  137. --
  138.   /  \    Bill Crews
  139.  ( bc )   Cyb Systems, Inc
  140.   \__/    Austin, Texas
  141.  
  142. [ gatech | ihnp4 | nbires | seismo | ucb-vax ] ! ut-sally ! cyb-eng ! bc
  143. -- 
  144.  
  145. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  146.  
  147. Volume-Number: Volume 1, Number 03
  148.  
  149. From jsq@ut-sally.UUCP Mon Jul 01 16:16:37 GMT 1985
  150. Path: ut-sally!jsq
  151. From: jsq@ut-sally.UUCP (John Quarterman)
  152. Newsgroups: mod.std.unix
  153. Subject: Re: command line arguments
  154. Message-ID: <2226@ut-sally.UUCP>
  155. Date: 1 Jul 85 16:16:37 GMT
  156. References: <2210@ut-sally.UUCP>
  157. Reply-To: std-unix@ut-sally.UUCP
  158. Organization: U. Texas CS Dept., Austin, Texas
  159. Lines: 154
  160. Approved: jsq@ut-sally.UUCP
  161. Draft-9: 1003.2.getopt
  162.  
  163. From: John Quarterman (moderator) <ut-sally!std-unix>
  164.  
  165. Topic: getopt (command line arguments)
  166.  
  167. The previous posting about standardization of command line options
  168. produced several comments about getopt, one of which I have already
  169. posted.  I've picked out new information from the others and included
  170. them here, after an excerpt from the original posting.
  171.  
  172. If your mail isn't excerpted here, it's not that I'm ignoring you:  it's
  173. merely that either yours duplicated what earlier mail had already said,
  174. or it was mailed to ut-sally!jsq rather than ut-sally!std-unix
  175. and I haven't gotten confirmation, or it never got to me.
  176.  
  177. ----------------------------------------------------------------------
  178.  
  179. Date: Thu, 27 Jun 85 18:08:26 bst
  180. From: Douglas Spencer <seismo!mcvax!daisy!maugg>
  181. Subject: Re: mod.std.unix created
  182. To: ut-sally!jsq
  183.  
  184. > some commands take arguments as
  185. > command -abcdefg filename
  186. > and some as
  187. > command -a -b -c -d -e -f -g filename
  188. > It would be great if this was standardised.
  189.  
  190. ------------------------------
  191.  
  192. Date: Sat, 29 Jun 85 08:42:41 edt
  193. From: Marty Shannon <seismo!allegra!eagle!mjs>
  194. Subject: Re: command line arguments
  195. To: ut-sally!jsq
  196.  
  197. Perhaps this should really be a followup rather than a reply, but there is a
  198. fairly strong move to standardize command argument parsing by using the getopt
  199. routine.  It deals quite well with the problem, as well as providing a great
  200. deal of flexibility.
  201.  
  202.     Marty Shannon
  203. UUCP:    ihnp4!eagle!mjs
  204. Phone:    +1 201 522 6063
  205.  
  206. [ Someone else notes in mail that the AT&T command line argument standard
  207. is included in the System V Interface Definition, page 343 of the Spring
  208. 1985 edition, and getopt conforms to this standard. -mod]
  209.  
  210. ------------------------------
  211.  
  212. Date: 29 Jun 85 23:49:35 CDT (Sat)
  213. From: Henry Spencer <ihnp4!utzoo!henry>
  214. Subject: Re: command line arguments
  215. To: ihnp4!ut-sally!std-unix
  216.  
  217. There is an AT&T standard for command argument syntax, and the getopt(3)
  218. parser which encourages its use.  (Incidentally, the standard says that
  219. both (for example) "ls -al" and "ls -a -l" are legit.)  AT&T has published
  220. its own getopt() sources to encourage use of getopt, and there is also
  221. an explicitly public-domain implementation that was published on the net
  222. some time ago (by me).
  223.  
  224. [ I find the following articles in net.sources about getopt:
  225.  
  226. >From: henry@utzoo.UUCP (Henry Spencer)
  227. Subject: public-domain getopt
  228. Message-ID: <3745@utzoo.UUCP>
  229. Date: Thu, 12-Apr-84 16:41:58 CST
  230.  
  231. >From: hansen@pegasus.UUCP (Tony L. Hansen)
  232. Subject: Re: public domain getopt
  233. Message-ID: <1253@pegasus.UUCP>
  234. Date: Tue, 1-May-84 09:54:16 CDT
  235.  
  236. >From: henry@utzoo.UUCP (Henry Spencer)
  237. Subject: minor bug in public-domain getopt
  238. Message-ID: <4188@utzoo.UUCP>
  239. Date: Tue, 7-Aug-84 15:31:16 CDT
  240.  
  241. >From: keith@seismo.UUCP (Keith Bostic)
  242. Subject: public domain getopt(3)
  243. Message-ID: <3360@seismo.UUCP>
  244. Date: Fri, 24-Aug-84 07:54:08 CDT
  245.  
  246. The first one is Henry's code, the next two are bug fixes to that,
  247. and the last one is a reimplementation by Keith Bostic.  -mod ]
  248.  
  249. Here at utzoo, most any time that we do significant work on a Bell program,
  250. we retrofit it with getopt unless its established syntax is seriously
  251. incompatible with this.  And of course all our own code uses it.  Getopt
  252. and its syntax have some defects, but uniformity is such a huge win that
  253. it's overwhelmingly worth it.
  254.  
  255.                 Henry Spencer @ U of Toronto Zoology
  256.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  257.  
  258. ------------------------------
  259.  
  260. Date:    Sun, 30 Jun 85  01:00 EDT
  261. From: George M. Weaver <ihnp4!psuvax1!GMW@PSUVM.BITNET>
  262. Subject: Re: command line arguments
  263. To: ut-sally!std-unix
  264.  
  265.      Frank da Cruz's new C-Kermit adopts a set of command line argument
  266. standards that are worth looking at.  He outlines them briefly, and gives
  267. credit to their creators in the Kermit User Manual, part of which I've
  268. included here (without permission -- hope you don't mind, Frank).
  269.  
  270. ===============================================================================
  271.  
  272. The C-Kermit command line syntax has been changed from that of earlier releases
  273. of Unix Kermit to conform to the "Proposed Syntax  Standards  for  Unix  System
  274. Commands"  put  forth  by  Kathy  Hemenway  and  Helene  Armitage  of AT&T Bell
  275. Laboratories in Unix/World, Vol.1, No.3, 1984.  The rules that apply are:
  276.  
  277.    - Command names must be between 2 and 9 characters ("kermit" is 6).
  278.    - Command names must include lower case letters and digits only.
  279.    - An option name is a single character.
  280.    - Options are delimited by '-'.
  281.    - Options with  no  arguments  may  be  grouped  (bundled)  behind  one
  282.      delimiter.
  283.    - Option-arguments cannot be optional.
  284.    - Arguments immediately follow options, separated by whitespace.
  285.    - The order of options does not matter.
  286.    - '-' preceded and followed by whitespace means standard input.
  287.  
  288. A group of bundled options may end with an option that has an argument.
  289.  
  290. ===============================================================================
  291.  
  292.  
  293. George M. Weaver
  294. Penn State Astronomy Dept.
  295. GMW at PSUVM.BITNET
  296. ...!allegra!psuvax1!gmw@psuvm.bitnet
  297.  
  298. ------------------------------
  299.  
  300. The moderated newsgroup mod.std.unix is for discussions of UNIX standards,
  301. in particular the one in progress by the IEEE P1003 "UNIX Standards" Committee.
  302.  
  303. Please mail submissions to mod.std.unix to ut-sally!std-unix,
  304. and comments about the newsgroup to ut-sally!std-unix-request.
  305. Permission for posting to the newsgroup is assumed for mail
  306. to the former address, but mail to the latter address will
  307. not be posted unless explicit permission is included, or obtained
  308. by later negotiation.  Mail to ut-sally!jsq concerning mod.std.unix
  309. will be treated like mail to ut-sally!std-unix-request.
  310. -- 
  311.  
  312. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  313.  
  314.  
  315. Volume-Number: Volume 1, Number 04
  316.  
  317. From jsq@ut-sally.UUCP Mon Jul 01 21:52:49 GMT 1985
  318. Path: ut-sally!jsq
  319. From: jsq@ut-sally.UUCP (John Quarterman)
  320. Newsgroups: mod.std.unix
  321. Subject: Access to P1003 draft and /usr/group standard
  322. Message-ID: <2233@ut-sally.UUCP>
  323. Date: 1 Jul 85 21:52:49 GMT
  324. References: <2210@ut-sally.UUCP>
  325. Reply-To: std-unix@ut-sally.UUCP
  326. Organization: U. Texas CS Dept., Austin, Texas
  327. Lines: 30
  328. Approved: jsq@ut-sally.UUCP
  329. Draft-9: D2.Access
  330.  
  331. From: John Quarterman (moderator) <ut-sally!std-unix>
  332.  
  333. Several people have asked how to get copies of the /usr/group standard
  334. and the current P1003 draft.
  335.  
  336. The /usr/group one is
  337.  
  338.     1984 /usr/group Standard
  339.     prepared by the
  340.     /usr/group Standards Committee
  341.     November 14, 1984
  342.     Copyright 1984 - /usr/group
  343.  
  344. and is available from
  345.  
  346.     /usr/group
  347.     4655 Old Ironside Drive, Suite 200
  348.     Santa Clara, California 95050
  349.     U.S.A.
  350.  
  351. Unfortunately, I don't know the price.
  352.  
  353.  
  354. There is a plan to make the current P1003 draft standard available for
  355. UUCP transfer from a well-known UUCP site, and for anonymous ftp from
  356. at least one ARPA Internet host.  The draft is being extensively
  357. revised right now, however, and cannot be made available quite yet.
  358. -- 
  359.  
  360. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  361.  
  362. Volume-Number: Volume 1, Number 05
  363.  
  364. From jsq@ut-sally.UUCP Mon Jul 01 22:27:43 GMT 1985
  365. Path: ut-sally!jsq
  366. From: jsq@ut-sally.UUCP (John Quarterman)
  367. Newsgroups: mod.std.unix
  368. Subject: P1003 questions and answers
  369. Message-ID: <2234@ut-sally.UUCP>
  370. Date: 1 Jul 85 22:27:43 GMT
  371. References: <2210@ut-sally.UUCP>
  372. Reply-To: std-unix@ut-sally.UUCP
  373. Organization: U. Texas CS Dept., Austin, Texas
  374. Lines: 63
  375. Approved: jsq@ut-sally.UUCP
  376. Draft-9: 5.1 6.5.2 8.0
  377.  
  378. From: John Quarterman (moderator) <ut-sally!std-unix>
  379.  
  380. Before the Portland USENIX Conference, or, more specifically, before
  381. the P1003 "UNIX Standards" committee meeting which was held on the
  382. three days before that USENIX, I solicited comments and questions about
  383. the P1003 standard on several newsgroups on USENET.  Here are most of
  384. the questions and my interpretation of how they relate to what the
  385. committee is doing.  Be aware that my interpretation may not correspond
  386. to reality, and is certainly not an official statement by the committee.
  387.  
  388. Is the P1003 draft standard compatible with the X3J11 C draft standard?
  389.  
  390.     This was one of the main things discussed at the meeting.
  391.     The P1003 committee is very concerned about compatibility
  392.     with X3J11, to the point of replacing large sections of
  393.     the P1003 draft standard with references to the X3J11 standard.
  394.     There are places where it's not that simple, though, such as
  395.     kill(2), because the C standard needs to define a small set
  396.     of functions, while the P1003 standard needs to define others.
  397.     A committee was appointed to communicate with X3J11.
  398.  
  399.     Someone asked specifically if <limits.h> would be compatible,
  400.     and the intention of the committee is that it will be.
  401.  
  402.     Someone else asked if signal(2) were defined properly using void.
  403.     At the moment, it's not.  I don't know if it will be later.
  404.  
  405. Database issues.
  406.  
  407.     File locking was referred to a /usr/group subcommittee,
  408.     which solicited members at a USENIX BOF.  This was because
  409.     the P1003 members are mostly not database experts, and
  410.     felt that problems with lockf could not be resolved by them
  411.     in a reasonable amount of time.  The committee did remove
  412.     the enforcement mode of lockf from the body of the draft
  413.     to an appendix.
  414.  
  415.     The 4.2BSD truncate system call is not in the draft standard,
  416.     and thus far no one has proposed that it should be.  Though
  417.     its utility is clear, there seems to be a strong reluctance
  418.     to add new facilities.
  419.  
  420. Are the 4.2BSD directory routines (opendir, readdir, closedir) included?
  421.  
  422.     They were recently added, in an appendix.
  423.  
  424.     Someone asked if the conflicts involving <sys/ndir.h> having
  425.     the same name but different functions on 4.2BSD and other
  426.     systems had been resolved.  The corresponding header file
  427.     is <dirent.h> in the draft standard.
  428.  
  429. Have windowing, graphics, or network standards been addressed?
  430.  
  431.     The committee takes pains to avoid precluding network
  432.     implementations of things such as file systems, but
  433.     does not directly address windowing, graphics, or networks.
  434.     There are /usr/group subcommittees on those subjects, however.
  435.  
  436.     If someone more knowledgeable would post something on the
  437.     /usr/group committees, I would appreciate it.
  438. -- 
  439.  
  440. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  441.  
  442. Volume-Number: Volume 1, Number 06
  443.  
  444. From jsq@ut-sally.UUCP Tue Jul 02 19:56:12 GMT 1985
  445. Path: ut-sally!jsq
  446. From: jsq@ut-sally.UUCP (John Quarterman)
  447. Newsgroups: mod.std.unix
  448. Subject: Re: command line arguments
  449. Message-ID: <2244@ut-sally.UUCP>
  450. Date: 2 Jul 85 19:56:12 GMT
  451. References: <2210@ut-sally.UUCP> <2226@ut-sally.UUCP>
  452. Organization: U. Texas CS Dept., Austin, Texas
  453. Lines: 30
  454. Approved: jsq@ut-sally.UUCP
  455. Draft-9: 1003.2.getopt
  456.  
  457. From: utastro!nather (Ed Nather)
  458.  
  459. >      Frank da Cruz's new C-Kermit adopts a set of command line argument
  460. > standards that are worth looking at. 
  461. > [...]
  462. > A group of bundled options may end with an option that has an argument.
  463.  
  464. This creates confusion in using C-Kermit when you want to send an image
  465. file.  For example:
  466.  
  467.     send -is filename     < ---  works fine
  468.         send -si filename     < ---  bombs the program
  469.  
  470. I personally find it hard to remember which is which, since they both seem
  471. equally sensible to me.  I would *much* prefer to bundle the flags, then
  472. have those with arguments pick them up in the same order as the flags are
  473. listed.  In the above case, the "-i" flag doesn't take an argument, so I
  474. think it should be processed but should not "shield" the "-s" flag from its
  475. argument.
  476.  
  477. But what do I know?
  478.  
  479. Ed Nather
  480. Astronomy Dept, U of Texas @ Austin
  481. {allegra,ihnp4}!{noao,ut-sally}!utastro!nather
  482. nather%utastro.UTEXAS@ut-sally.ARPA
  483.  
  484. -- 
  485.  
  486. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  487.  
  488. Volume-Number: Volume 1, Number 07
  489.  
  490. From jsq@ut-sally.UUCP Thu Jul 04 13:37:53 GMT 1985
  491. Path: ut-sally!jsq
  492. From: jsq@ut-sally.UUCP (John Quarterman)
  493. Newsgroups: mod.std.unix
  494. Subject: Re: command line arguments
  495. Message-ID: <2255@ut-sally.UUCP>
  496. Date: 4 Jul 85 13:37:53 GMT
  497. References: <2210@ut-sally.UUCP> <2226@ut-sally.UUCP>, <2244@ut-sally.UUCP>
  498. Organization: U. Texas CS Dept., Austin, Texas
  499. Lines: 76
  500. Approved: jsq@ut-sally.UUCP
  501. Draft-9: 1003.2.getopt
  502.  
  503. From: John Quarterman (moderator) <ut-sally!std-unix>
  504.  
  505. Topic: more on getopt (command line arguments)
  506.  
  507. This article will be followed by one more, containing source and man page
  508. for a public domain getopt.  That should about wrap this subject up.  -mod
  509.  
  510. ----------------------------------------------------------------------
  511.  
  512. From: Randy D. Smith <ihnp4!decvax!mcnc!rtp47!smithrd>
  513. Date: Mon, 1 Jul 85 07:58:42 edt
  514. Apparently-To: mcnc!ihnp4!ut-sally!std-unix
  515.  
  516. P1003 definitely intends to address commands and the command
  517. interface (e.g., sh).  That work has been sidetracked in order
  518. to devote our efforts to getting the current core of the draft
  519. (system call stuff) out the door.  I believe everyone on the
  520. committee fully expects that commands/command line will be a
  521. top priority after the draft goes out, is balloted, and the
  522. ballots are resolved.
  523.  
  524. There has been some consensus already on the command line interface,
  525. based on "An Enhanced Getopt" by T. C. Jones and L. A. Kennedy
  526. of AT&T Bell Labs.  As mentioned in previous messages, this should
  527. help us in the future, although history already stuck us with
  528. a variety of interfaces to existing commands.
  529. --
  530.                 Randy D. Smith    (919) 248-6136
  531.                Data General, Research Triangle Park, NC
  532.              <the known world>!mcnc!rti-sel!rtp47!smithrd
  533. <General disclaimer:
  534.     :r jsq's original posting about committee member's opinions
  535.     being their own and not that of the entire committee...
  536. >
  537.  
  538. ------------------------------
  539.  
  540. Date: Wed, 3 Jul 85 11:06:19 edt
  541. From: seismo!ulysses!smb (Steven Bellovin)
  542. To: ut-sally!std-unix
  543. Subject: Re: command line arguments
  544.  
  545. I believe I heard at Usenix that AT&T has put their version of getopt()
  546. into the public domain.  Can anyone confirm this?
  547.  
  548.         --Steve Bellovin
  549.         ulysses!smb
  550.  
  551. ------------------------------
  552.  
  553. Date: Sat, 29 Jun 85 16:55:37 edt
  554. From: ihnp4!utcs!ian (Ian F. Darwin)
  555. To: ut-sally!jsq
  556.  
  557. There is an AT&T standard for command line arguments.
  558. It was published about a year ago (washington??).
  559. It is included in the Sys V interface Definition, page 343
  560. of the Spring 85 edition.
  561.  
  562. There is a routine called `getopt(3)' that parses options
  563. according to this standard. Bell published the `official'
  564. source at UniForum in Dallas; several public-domain versions
  565. (at least one with cleaner coding style!) have appeared on
  566. the net. Send me mail if you don't have a copy, because
  567. *everybody writing C programs should be using getopt()
  568. to parse their command line options*.
  569.  
  570. Thanks
  571.  
  572. Ian Darwin, Toronto
  573. ihnp4!darwin!ian
  574.  
  575. ----------------------------------------------------------------------
  576. -- 
  577.  
  578. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  579.  
  580. Volume-Number: Volume 1, Number 08
  581.  
  582. From jsq@ut-sally.UUCP Thu Jul 04 14:54:39 GMT 1985
  583. Path: ut-sally!jsq
  584. From: jsq@ut-sally.UUCP (John Quarterman)
  585. Newsgroups: mod.std.unix
  586. Subject: Re: command line arguments
  587. Message-ID: <2256@ut-sally.UUCP>
  588. Date: 4 Jul 85 14:54:39 GMT
  589. References: <2210@ut-sally.UUCP> <2226@ut-sally.UUCP>, <2244@ut-sally.UUCP> <2255@ut-sally.UUCP>
  590. Organization: U. Texas CS Dept., Austin, Texas
  591. Lines: 433
  592. Approved: jsq@ut-sally.UUCP
  593. Draft-9: 1003.2.getopt
  594.  
  595. From: John Quarterman (moderator) <ut-sally!std-unix>
  596.  
  597. Topic: yet more on getopt (command line arguments)
  598.  
  599. Two more messages, the first a followup to a previous posting, and
  600. the second public domain sources and man pages for getopt(3) and getopt(1).
  601.     -mod
  602.  
  603. ----------------------------------------------------------------------
  604.  
  605. From: ihnp4!utzoo!henry
  606. Date: 3 Jul 85 18:34:41 CDT (Wed)
  607. To: ihnp4!ut-sally!std-unix
  608. Subject: Re: command line arguments
  609.  
  610. > > A group of bundled options may end with an option that has an argument.
  611. > This creates confusion in using C-Kermit when you want to send an image
  612. > file.  For example:
  613. >     send -is filename     < ---  works fine
  614. >         send -si filename     < ---  bombs the program
  615.  
  616. The AT&T syntax standard (which getopt does not completely enforce)
  617. actually forbids both of these usages.  Options with arguments are not
  618. allowed to be bundled, and they must be separated from their arguments
  619. by a space.
  620.  
  621. > I would *much* prefer to bundle the flags, then
  622. > have those with arguments pick them up in the same order as the flags are
  623. > listed.
  624.  
  625. The few existing commands that use such a convention, notably tar(1), are
  626. (in my experience) the worse for it.  It's seriously error-prone.  I think
  627. the AT&T people did the right thing.
  628.  
  629. ------------------------------
  630.  
  631. Date: Tue, 2 Jul 85 13:07:09 edt
  632. From: ihnp4!utcs!ian (Ian F. Darwin)
  633. To: ihnp4!ut-sally!jsq@tzec.UTEXAS.ARPA
  634. Subject: here is getopt
  635.  
  636. Here is the source for getopt(3), the function that should be in
  637. everybody's C program, and getopt(1), a program that uses it to
  638. make shell programs comprehensible and consistent. There are man
  639. pages for both. Please send these on to the mod. group. Thanks.
  640.  
  641. [ I have hacked the following shell script slightly so that
  642. it doesn't extract directly into system source directories,
  643. rather into the current directory.  It should be assumed that
  644. this code comes with no warranty from me, Ian Darwin, or anyone
  645. else as to whether it accurately represents getopt as distributed
  646. with System V, or any command line standard, or that it works
  647. at all, or that it will cause no damage when extracted or used. -mod]
  648.  
  649. #! /bin/sh
  650. #! To unbundle, sh this file
  651. echo x - "(/usr/man/man3/getopt.3)" >&2
  652. echo x - mkdir lib >&2
  653. mkdir lib >&2
  654. echo x - lib/getopt.3 >&2
  655. cat >lib/getopt.3 <<"//SYSIN DD SYSOUT=BD"
  656. .TH GETOPT 3 local
  657. .DA 25 March 1982
  658. .SH NAME
  659. getopt \- get option letter from argv
  660. .SH SYNOPSIS
  661. .ft B
  662. int getopt(argc, argv, optstring)
  663. .br
  664. int argc;
  665. .br
  666. char **argv;
  667. .br
  668. char *optstring;
  669. .sp
  670. extern char *optarg;
  671. .br
  672. extern int optind;
  673. .ft
  674. .SH DESCRIPTION
  675. .I Getopt
  676. returns the next option letter in
  677. .I argv
  678. that matches a letter in
  679. .IR optstring .
  680. .I Optstring
  681. is a string of recognized option letters;
  682. if a letter is followed by a colon, the option is expected to have
  683. an argument that may or may not be separated from it by white space.
  684. .I Optarg
  685. is set to point to the start of the option argument on return from
  686. .IR getopt .
  687. .PP
  688. .I Getopt
  689. places in
  690. .I optind
  691. the
  692. .I argv
  693. index of the next argument to be processed.
  694. Because
  695. .I optind
  696. is external, it is normally initialized to zero automatically
  697. before the first call to 
  698. .IR getopt .
  699. .PP
  700. When all options have been processed (i.e., up to the first
  701. non-option argument),
  702. .I getopt
  703. returns
  704. .BR EOF .
  705. The special option
  706. .B \-\-
  707. may be used to delimit the end of the options;
  708. .B EOF
  709. will be returned, and
  710. .B \-\-
  711. will be skipped.
  712. .SH SEE ALSO
  713. getopt(1)
  714. .SH DIAGNOSTICS
  715. .I Getopt
  716. prints an error message on
  717. .I stderr
  718. and returns a question mark
  719. .RB ( ? )
  720. when it encounters an option letter not included in
  721. .IR optstring .
  722. .SH EXAMPLE
  723. The following code fragment shows how one might process the arguments
  724. for a command that can take the mutually exclusive options
  725. .B a
  726. and
  727. .BR b ,
  728. and the options
  729. .B f
  730. and
  731. .BR o ,
  732. both of which require arguments:
  733. .PP
  734. .RS
  735. .nf
  736. main(argc, argv)
  737. int argc;
  738. char **argv;
  739. {
  740.     int c;
  741.     extern int optind;
  742.     extern char *optarg;
  743.     \&.
  744.     \&.
  745.     \&.
  746.     while ((c = getopt(argc, argv, "abf:o:")) != EOF)
  747.         switch (c) {
  748.         case 'a':
  749.             if (bflg)
  750.                 errflg++;
  751.             else
  752.                 aflg++;
  753.             break;
  754.         case 'b':
  755.             if (aflg)
  756.                 errflg++;
  757.             else
  758.                 bproc();
  759.             break;
  760.         case 'f':
  761.             ifile = optarg;
  762.             break;
  763.         case 'o':
  764.             ofile = optarg;
  765.             break;
  766.         case '?':
  767.         default:
  768.             errflg++;
  769.             break;
  770.         }
  771.     if (errflg) {
  772.         fprintf(stderr, "Usage: ...");
  773.         exit(2);
  774.     }
  775.     for (; optind < argc; optind++) {
  776.         \&.
  777.         \&.
  778.         \&.
  779.     }
  780.     \&.
  781.     \&.
  782.     \&.
  783. }
  784. .RE
  785. .PP
  786. A template similar to this can be found in
  787. .IR /usr/pub/template.c .
  788. .SH HISTORY
  789. Written by Henry Spencer, working from a Bell Labs manual page.
  790. Behavior believed identical to the Bell version.
  791. .SH BUGS
  792. It is not obvious how
  793. `\-'
  794. standing alone should be treated;  this version treats it as
  795. a non-option argument, which is not always right.
  796. .PP
  797. Option arguments are allowed to begin with `\-';
  798. this is reasonable but reduces the amount of error checking possible.
  799. .PP
  800. .I Getopt
  801. is quite flexible but the obvious price must be paid:  there is much
  802. it could do that it doesn't, like
  803. checking mutually exclusive options, checking type of
  804. option arguments, etc.
  805. //SYSIN DD SYSOUT=BD
  806. echo x - "(/usr/man/man1/getopt.1)" >&2
  807. echo x - mkdir bin >&2
  808. mkdir bin >&2
  809. echo x - bin/getopt.1 >&2
  810. cat >bin/getopt.1 <<"//SYSIN DD SYSOUT=BD"
  811. .TH GETOPT 1 local
  812. .DA 12 April 1984
  813. .SH NAME
  814. getopt \- parse command options
  815. .SH SYNOPSIS
  816. .B set \-\- \`getopt
  817. optstring
  818. .B $*\`
  819. .SH DESCRIPTION
  820. .I Getopt
  821. is used to break up options in command lines for easy parsing by
  822. shell procedures, and to check for legal options.
  823. .I Optstring
  824. is a string of recognized option letters (see
  825. .IR getopt (3));
  826. if a letter is followed by a colon, the option
  827. is expected to have an argument which may or may not be
  828. separated from it by white space.
  829. The special option
  830. .B \-\-
  831. is used to delimit the end of the options.
  832. .I Getopt
  833. will place
  834. .B \-\-
  835. in the arguments at the end of the options,
  836. or recognize it if used explicitly.
  837. The shell arguments
  838. (\fB$1 $2\fR ...) are reset so that each option is
  839. preceded by a
  840. .B \-
  841. and in its own shell argument;
  842. each option argument is also in its own shell argument.
  843. .SH EXAMPLE
  844. The following code fragment shows how one might process the arguments
  845. for a command that can take the options
  846. .B a
  847. and
  848. .BR b ,
  849. and the option
  850. .BR o ,
  851. which requires an argument.
  852. .PP
  853. .RS
  854. .nf
  855. set \-\- \`getopt abo: $*\`
  856. if test $? != 0
  857. then
  858.     echo 'Usage: ...'
  859.     exit 2
  860. fi
  861. for i
  862. do
  863.     case "$i"
  864.     in
  865.         \-a|\-b)
  866.             flag=$i; shift;;
  867.         \-o)
  868.             oarg=$2; shift; shift;;
  869.         \-\-)
  870.             shift; break;;
  871.     esac
  872. done
  873. .fi
  874. .RE
  875. .PP
  876. This code will accept any of the following as equivalent:
  877. .PP
  878. .RS
  879. .nf
  880. cmd \-aoarg file file
  881. cmd \-a \-o arg file file
  882. cmd \-oarg -a file file
  883. cmd \-a \-oarg \-\- file file
  884. .RE
  885. .PP
  886. A program template similar to this example can be found in
  887. .IR /usr/pub/template.sh .
  888. .SH SEE ALSO
  889. sh(1), getopt(3)
  890. .SH DIAGNOSTICS
  891. .I Getopt
  892. prints an error message on the standard error output when it
  893. encounters an option letter not included in
  894. .IR optstring .
  895. .SH HISTORY
  896. Written by Henry Spencer, working from a Bell Labs manual page.
  897. Behavior believed identical to the Bell version.
  898. .SH BUGS
  899. Whatever
  900. .IR getopt (3)
  901. has.
  902. .PP
  903. Arguments containing white space or imbedded shell metacharacters
  904. generally will not survive intact;  this looks easy to fix but isn't.
  905. .PP
  906. The error message for an invalid option is identified as coming
  907. from
  908. .I getopt
  909. rather than from the shell procedure containing the invocation
  910. of
  911. .IR getopt ;
  912. this again is hard to fix.
  913. .PP
  914. The precise best way to use the
  915. .I set
  916. command to set the arguments without disrupting the value(s) of
  917. shell options varies from one shell version to another.
  918. //SYSIN DD SYSOUT=BD
  919. echo x - "(/usr/src/lib/libc/gen/getopt.c)" >&2
  920. echo x - lib/getopt.c >&2
  921. cat >lib/getopt.c <<"//SYSIN DD SYSOUT=BD"
  922. /*
  923.  * getopt - get option letter from argv
  924.  */
  925.  
  926. #include <stdio.h>
  927.  
  928. char    *optarg;    /* Global argument pointer. */
  929. int    optind = 0;    /* Global argv index. */
  930.  
  931. static char    *scan = NULL;    /* Private scan pointer. */
  932.  
  933. extern char    *index();
  934.  
  935. int
  936. getopt(argc, argv, optstring)
  937. int argc;
  938. char *argv[];
  939. char *optstring;
  940. {
  941.     register char c;
  942.     register char *place;
  943.  
  944.     optarg = NULL;
  945.  
  946.     if (scan == NULL || *scan == '\0') {
  947.         if (optind == 0)
  948.             optind++;
  949.     
  950.         if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
  951.             return(EOF);
  952.         if (strcmp(argv[optind], "--")==0) {
  953.             optind++;
  954.             return(EOF);
  955.         }
  956.     
  957.         scan = argv[optind]+1;
  958.         optind++;
  959.     }
  960.  
  961.     c = *scan++;
  962.     place = index(optstring, c);
  963.  
  964.     if (place == NULL || c == ':') {
  965.         fprintf(stderr, "%s: unknown option -%c\n", argv[0], c);
  966.         return('?');
  967.     }
  968.  
  969.     place++;
  970.     if (*place == ':') {
  971.         if (*scan != '\0') {
  972.             optarg = scan;
  973.             scan = NULL;
  974.         } else if (optind < argc) {
  975.             optarg = argv[optind];
  976.             optind++;
  977.         } else {
  978.             fprintf(stderr, "%s: -%c argument missing\n", argv[0], c);
  979.             return('?');
  980.         }
  981.     }
  982.  
  983.     return(c);
  984. }
  985. //SYSIN DD SYSOUT=BD
  986. echo x - "(/usr/src/bin/getopt.c)" >&2
  987. echo x - bin/getopt.c >&2
  988. cat >bin/getopt.c <<"//SYSIN DD SYSOUT=BD"
  989. #include <stdio.h>
  990.  
  991. main(argc, argv)
  992. int argc;
  993. char *argv[];
  994. {
  995.     extern int optind;
  996.     extern char *optarg;
  997.     int c;
  998.     int status = 0;
  999.  
  1000.     optind = 2;    /* Past the program name and the option letters. */
  1001.     while ((c = getopt(argc, argv, argv[1])) != EOF)
  1002.         switch (c) {
  1003.         case '?':
  1004.             status = 1;    /* getopt routine gave message */
  1005.             break;
  1006.         default:
  1007.             if (optarg != NULL)
  1008.                 printf(" -%c %s", c, optarg);
  1009.             else
  1010.                 printf(" -%c", c);
  1011.             break;
  1012.         }
  1013.     printf(" --");
  1014.     for (; optind < argc; optind++)
  1015.         printf(" %s", argv[optind]);
  1016.     printf("\n");
  1017.     exit(status);
  1018. }
  1019. //SYSIN DD SYSOUT=BD
  1020. exit 0
  1021.  
  1022. ----------------------------------------------------------------------
  1023. -- 
  1024.  
  1025. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  1026.  
  1027. Volume-Number: Volume 1, Number 09
  1028.  
  1029. From jsq@ut-sally.UUCP Thu Jul 04 15:52:35 GMT 1985
  1030. Path: ut-sally!jsq
  1031. From: jsq@ut-sally.UUCP (John Quarterman)
  1032. Newsgroups: mod.std.unix
  1033. Subject: curses, terminfo, and termcap
  1034. Message-ID: <2257@ut-sally.UUCP>
  1035. Date: 4 Jul 85 15:52:35 GMT
  1036. Organization: U. Texas CS Dept., Austin, Texas
  1037. Lines: 69
  1038. Approved: jsq@ut-sally.UUCP
  1039. Draft-9: curses
  1040.  
  1041. From: John Quarterman (moderator) <ut-sally!std-unix>
  1042.  
  1043. Topic: curses, terminfo, and termcap
  1044.  
  1045. The moderated newsgroup mod.std.unix is for discussions of UNIX standards,
  1046. in particular of the draft standard in progress by the IEEE P1003
  1047. "UNIX Standards" Committee.
  1048.  
  1049. Please mail submissions to the newsgroup to:    ut-sally!std-unix
  1050. Mail to this address will be posted to mod.std.unix unless it is
  1051. redundant or otherwise inappropriate, when I will reply by mail
  1052. with suggestions on where else it might be appropriate.
  1053.  
  1054. Please mail comments about the newsgroup to:    ut-sally!std-unix-request
  1055. Mail to this address will not be posted to mod.std.unix unless explicit
  1056. permission is included in the mail, though I may reply with a request
  1057. for permission to post.  Mail to ut-sally!jsq regarding mod.std.unix
  1058. is treated like mail to ut-sally!std-unix-request.
  1059.  
  1060. It is possible to reach ut-sally through ihnp4, seismo, gatech, and harvard,
  1061. among other UUCP connections, and as ut-sally.ARPA through the ARPA Internet
  1062. or CSNET.  -mod
  1063.  
  1064. ----------------------------------------------------------------------
  1065.  
  1066. Date: Tue, 2 Jul 85 15:49:39 CDT
  1067. From: Stan Barber <neuro1!sob@RICE.ARPA>
  1068. Subject: curses
  1069. Apparently-To: std-unix@ut-sally.arpa
  1070.  
  1071. With the posting of the game "Battleship" in net.sources.games recently 
  1072. came the realization that curses is not the same on SYSVr2 and BSD.
  1073.  
  1074. After reading the instructions on SYSVr2, I think is is more powerful than
  1075. the Ken Arnold original. It also seems upward compartable (for the most 
  1076. part) with Ken Arnold.
  1077.  
  1078. I am not sure if curses is considered part of the "standard", but would
  1079. like to see some discussion of this as well as the larger issure of
  1080. termcap vs. terminfo format for terminal capabilities.
  1081. Stan
  1082.  
  1083. [
  1084. There has been recent discussion of all these things in net.unix.
  1085. The System V Release 2 curses has apparently been extensively modified
  1086. by Mark Horton, to do input translation, among other things.  He also
  1087. appears to be largely responsible for terminfo.
  1088.  
  1089. The world seems to be moving from termcap to terminfo (for good reason,
  1090. I think).  There is a public domain termcap to terminfo translator.
  1091.     From: robert@gitpyr.UUCP (Robert Viduya)
  1092.     Newsgroups: net.sources
  1093.     Subject: termcap to terminfo translator
  1094.     Message-ID: <83@gitpyr.UUCP>
  1095.     Date: 30 Jan 85 20:42:01 GMT
  1096.     Organization: Georgia Tech, Atlanta
  1097.  
  1098. A public domain version of curses and terminfo by Pavel Curtis of
  1099. Cornell University was posted to mod.sources in December 1984.
  1100. It appears to include most of the System V Release 2 innovations.
  1101.  
  1102. I seem to recall that terminfo is supposed to be supplied with 4.3BSD,
  1103. perhaps as user contributed software, but I don't remember for sure.
  1104.     -mod ]
  1105.  
  1106. ----------------------------------------------------------------------
  1107. -- 
  1108.  
  1109. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  1110.  
  1111. Volume-Number: Volume 1, Number 10
  1112.  
  1113. From jsq  Sun Jul  7 10:50:56 1985
  1114. Path: ut-sally!jsq
  1115. From: jsq@ut-sally.UUCP (John Quarterman)
  1116. Newsgroups: mod.std.unix
  1117. Subject: Re: command line arguments
  1118. Message-Id: <2280@ut-sally.UUCP>
  1119. Date: 7 Jul 85 15:50:48 GMT
  1120. References: <2210@ut-sally.UUCP> <2226@ut-sally.UUCP>, <2244@ut-sally.UUCP> <2255@ut-sally.UUCP> <2256@ut-sally.UUCP>
  1121. Organization: U. Texas CS Dept., Austin, Texas
  1122. Lines: 88
  1123. Approved: jsq@ut-sally.UUCP
  1124. Draft-9: 1003.2.getopt
  1125.  
  1126. From: <jsq@ut-sally.UUCP> John Quarterman (moderator)
  1127.  
  1128. Topic: getopt (command line arguments) continued
  1129.  
  1130. This looks like it is going to be a backburner discussion for some time.
  1131.  
  1132. It has been noted in mail that the other getopt than the one I posted
  1133. may be superior, and that it would be good to post whichever is the best
  1134. to mod.sources or net.sources again, as those get archived on many hosts.
  1135. Negotiations are in progress.
  1136.  
  1137. Note the address for submissions to mod.std.unix is ihnp4!ut-sally!std-unix.
  1138. Mark Horton is very efficient, but he's got his own newsgroups to moderate....
  1139.  
  1140. ----------------------------------------------------------------------
  1141.  
  1142. Date: Wed, 3 Jul 85 16:51:43 edt
  1143. From: wfmans@ihuxb.uucp
  1144. Subject: Re: command line arguments
  1145. To: mark@cbosgd.ATT.UUCP
  1146. References: <2220@ut-sally.UUCP>
  1147.  
  1148. > > some commands take arguments as
  1149. > > 
  1150. > > command -abcdefg filename
  1151. > > 
  1152. > > and some as
  1153. > > 
  1154. > > command -a -b -c -d -e -f -g filename
  1155. > > 
  1156. > > It would be great if this was standardised.
  1157.  
  1158. The thing that burns me about some commands (and these are usually
  1159. experimental tools, mind you, real UNIX commands seem to work ok)
  1160. is that while most will accept
  1161. command -flag           and        command - flag
  1162. some will only accept one or the other.
  1163. I suppose that its easier to process the latter with a shell script
  1164. if you don't use getopt, but it sure is a pain.
  1165.  
  1166. ------------------------------
  1167.  
  1168. Date: Wed, 3 Jul 85 12:58:16 cdt
  1169. From: neuro1!baylor!peter@rice.uucp (Peter da Silva)
  1170. Subject: Re: Re: command line arguments
  1171. Newsgroups: mod.std.unix
  1172. To: neuro1!mark@cbosgd.ARPA
  1173. References: <2210@ut-sally.UUCP> <2226@ut-sally.UUCP>
  1174.  
  1175. :-) Look! No quotes!
  1176.  
  1177. I doubt the necessity and even the wisdom of seperating an argument from
  1178. the option by whitespace. I also dislike the blackballing of multicharacter
  1179. options.
  1180.  
  1181. Since no arguments are allowed to be optional there's no point in
  1182. distinguishing between '-t/dev/tty4' and '-t /dev/tty4'. Since 't'
  1183. requires an argument the parsing is unambiguous.
  1184.  
  1185. It makes it harder to write transparent shell scripts. Atomic options make
  1186. it much easier to pass stuff onto other programs. Parsing options in shell
  1187. scripts is pretty much a lossage anyway, so why make things harder?
  1188.  
  1189. As for multicharater options: do you intend to kill "tail -30"? Since
  1190. changing the number of lines is the most common case what's the problem?
  1191. At any rate you should allow a simple '-nnn' for a high-usage.
  1192.  
  1193. [ Since tar is the standard for data interchange (actually, only the
  1194. format of the tar data, not the tar program, is currently in the draft
  1195. standard), I suspect there will always be anomalies.  The advantage
  1196. of getopt is not that it's perfect, just that it's close enough and
  1197. widespread enough that it has some chance of being adopted everywhere.
  1198.  -mod ]
  1199.  
  1200. ----------------------------------------------------------------------
  1201.  
  1202. The moderated newsgroup mod.std.unix is for discussions of UNIX standards,
  1203. in particular of the draft standard in progress by the IEEE P1003
  1204. "UNIX Standards" Committee.
  1205.  
  1206. Submissions to the newsgroup to:    ut-sally!std-unix
  1207. Comments about the newsgroup to:    ut-sally!std-unix-request
  1208. Permission to post to the newsgroup is assumed for mail to the former address,
  1209. but not for mail to the latter address, nor for mail to my personal addresses.
  1210. -- 
  1211.  
  1212. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  1213.  
  1214. Volume-Number: Volume 1, Number 11
  1215.  
  1216. From jsq  Mon Jul  8 11:33:38 1985
  1217. Path: ut-sally!jsq
  1218. From: jsq@ut-sally.UUCP (John Quarterman)
  1219. Newsgroups: mod.std.unix
  1220. Subject: Re: curses, terminfo, and termcap
  1221. Message-Id: <2294@ut-sally.UUCP>
  1222. Date: 8 Jul 85 16:33:25 GMT
  1223. References: <2257@ut-sally.UUCP>
  1224. Reply-To: std-unix-request@ut-sally
  1225. Organization: U. Texas CS Dept., Austin, Texas
  1226. Lines: 70
  1227. Approved: jsq@ut-sally.UUCP
  1228. Draft-9: curses
  1229.  
  1230. From: John Quarterman (moderator) <ut-sally!std-unix>
  1231.  
  1232. Topic:  curses, terminfo, and termcap
  1233.  
  1234. ----------------------------------------------------------------------
  1235.  
  1236. Date: Sat, 6 Jul 85 01:06:24 edt
  1237. From: cbosgd.ATT!mark@seismo (Mark Horton)
  1238. To: std-unix@ut-sally.arpa
  1239. Subject: curses as part of the standard
  1240.  
  1241. The System V curses was intended to be mostly upward compatible with
  1242. Ken Arnold's version (the one in 4BSD).  It doesn't include a couple
  1243. of nonportable features, such as the 2 letter variables in curses.h
  1244. and the 4BSD way of getting at your erase character; there are portable
  1245. ways of doing this provided.
  1246.  
  1247. What I think is important about curses is not the code that implements
  1248. it (although this code was hard and it shouldn't have to be done more
  1249. than once) but the interface between the program and the package.
  1250. Curses is intended as a way to write portable screen oriented applications.
  1251. There are a number of functions in curses to enhance portability of the
  1252. application, some of which have little to do with screen handling but
  1253. seem to be needed by many screen oriented programs.  A curses application
  1254. should not care whether it's running on System V, 4.2BSD, or MS DOS.
  1255.  
  1256. Simpler implementations of curses that work on a PC make sense.  I know
  1257. of two implementations for MS DOS and one for QNX.  I also know of two
  1258. for UNIX that don't do optimization of handle braindamaged terminals, but
  1259. assume 9600 baud and an ordinary (or specific) terminal.
  1260.  
  1261. I personally would like to see curses (or some appripriate subset) become
  1262. part of the C standard, along with Standard I/O.  However, it appears that
  1263. the committee is not planning to do this.  Lacking this, I would like to
  1264. see it become part of a UNIX standard.
  1265.  
  1266.     Mark Horton
  1267.  
  1268. ----------------------------------------------------------------------
  1269.  
  1270. Date: Mon, 8 Jul 85 10:15:56 cdt
  1271. From: John Quarterman (moderator) <jsq@ut-sally.ARPA>
  1272. To: std-unix
  1273. Subject: public domain curses and terminfo
  1274.  
  1275. While I agree with Mark Horton that it shouldn't be necessary to
  1276. implement curses more than once, it appears that somebody else has also
  1277. done it.  I've gotten a couple of requests for more information on the
  1278. posting of it to mod.sources last November.  The first posting
  1279. contained this signature:
  1280.  
  1281.             Pavel Curtis
  1282.         Computer Science Dept.
  1283.         405 Upson Hall
  1284.         Cornell University
  1285.         Ithaca, NY 14853
  1286.         
  1287.         Ph- (607) 256-4934
  1288.         
  1289.         decvax!cornell!pavel        (UUCP)
  1290.         Pavel.Cornell@Udel-Relay    (ARPA)
  1291.  
  1292. The moderator of mod.sources is genrad!john, who would know better
  1293. than I what arrangements have been made for access to mod.sources archives.
  1294.  
  1295. ----------------------------------------------------------------------
  1296. -- 
  1297.  
  1298. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  1299. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  1300.  
  1301. Volume-Number: Volume 1, Number 12
  1302.  
  1303. From jsq  Mon Jul  8 11:52:09 1985
  1304. Path: ut-sally!jsq
  1305. From: jsq@ut-sally.UUCP (John Quarterman)
  1306. Newsgroups: mod.std.unix
  1307. Subject: ARPA Internet access to mod.std.unix
  1308. Message-Id: <2295@ut-sally.UUCP>
  1309. Date: 8 Jul 85 16:51:54 GMT
  1310. Reply-To: std-unix-request@ut-sally
  1311. Organization: U. Texas CS Dept., Austin, Texas
  1312. Lines: 37
  1313. Approved: jsq@ut-sally.UUCP
  1314. Draft-9: mod.std.unix
  1315.  
  1316. From: John Quarterman (moderator) <ut-sally!std-unix>
  1317.  
  1318. Several people have expressed interest in getting mod.std.unix by mail
  1319. over the ARPA Internet.  I've set up automatic forwarding of postings
  1320. to the newsgroup to a list of Internet addresses from ut-sally.  As long
  1321. as the size of the list remains small, I will keep the list on sally.
  1322. If it gets large, I will try to find some host better set up for such
  1323. forwarding to take it over.
  1324.  
  1325. There was a suggestion to funnel mod.std.unix into UNIX-WIZARDS, as
  1326. mod.std.c is funnelled into INFO-C.  I think this would be a bad idea,
  1327. considering the amount of junk in UNIX-WIZARDS.  Same for INFO-UNIX.
  1328.  
  1329. Eventually, I will put a listing in [SRI-NIC]<NETINFO>INTEREST-GROUPS.TXT,
  1330. which is the registry for Internet mailing lists.  For the moment, the
  1331. appropriate information is as follows:
  1332.  
  1333. The moderated newsgroup mod.std.unix is for discussions of UNIX standards,
  1334. in particular of the draft standard in progress by the IEEE P1003
  1335. "UNIX Standards" Committee.  It is gatewayed to a mailing list on
  1336. the ARPA Internet.
  1337.  
  1338. Submissions to the newsgroup (permission to post assumed) to:
  1339.                UUCP:  ut-sally!std-unix
  1340.     ARPA Internet and CSNET:  std-unix@ut-sally.ARPA
  1341. Comments about the newsgroup (permission to post not assumed) to:
  1342.                UUCP:  ut-sally!std-unix-request
  1343.     ARPA Internet and CSNET:  std-unix-request@ut-sally.ARPA
  1344.  
  1345. Mail to my personal addresses about the newsgroup will be treated
  1346. like mail to std-unix-request.
  1347.  
  1348. Note that ut-sally.ARPA will soon become SALLY.UTEXAS.EDU.
  1349. -- 
  1350.  
  1351. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  1352. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  1353.  
  1354. Volume-Number: Volume 1, Number 13
  1355.  
  1356. From jsq  Mon Jul  8 14:40:14 1985
  1357. Path: ut-sally!jsq
  1358. From: jsq@ut-sally.UUCP (John Quarterman)
  1359. Newsgroups: mod.std.unix
  1360. Subject: Re: command line arguments
  1361. Message-Id: <2300@ut-sally.UUCP>
  1362. Date: 8 Jul 85 19:40:08 GMT
  1363. References: <2210@ut-sally.UUCP> <2226@ut-sally.UUCP>, <2244@ut-sally.UUCP> <2255@ut-sally.UUCP> <2256@ut-sally.UUCP> <2280@ut-sally.UUCP>
  1364. Reply-To: std-unix-request@ut-sally
  1365. Organization: U. Texas CS Dept., Austin, Texas
  1366. Lines: 94
  1367. Approved: jsq@ut-sally.UUCP
  1368. Draft-9: 1003.2.getopt
  1369.  
  1370. Date: Mon, 8 Jul 85 12:51:54 EDT
  1371. From: Keith Bostic <seismo!keith>
  1372. To: ut-sally!std-unix
  1373. Subject: Public domain version of getopt(3)
  1374.  
  1375.  
  1376. John, you posted Henry Spencer's original version of getopt (message
  1377. #11, I believe) unless you've posted two versions.  [ I've posted only
  1378. one before, which was Henry Spencer's.  -mod ] The reason that I
  1379. reimplemented after that version was:
  1380.  
  1381.     1: his used the stdio library printf call, thus forcing the
  1382.         loading of some large routines even if your program
  1383.         didn't need them.
  1384.     2: his didn't have the same error messages that the SysV one had.
  1385.     3: his didn't use certain external variables (optarg,
  1386.         opterr, optind and optopt) that the SysV one had.
  1387.  
  1388. Obviously, #3 is the real reason, the others were bug fixes if
  1389. anything.  In any case, the version I sent to you (it's included below
  1390. if you've lost it) [ I have the one from net.sources, but I thought it
  1391. best to get whatever your latest version is.  If you mailed me one
  1392. before, it never arrived, possibly because my sun crashed about that
  1393. time.  -mod ] is the version that will be released with 4.3BSD and, as
  1394. far as I know, is totally compatible with SysV.  [ How about sending
  1395. it to mod.sources, as well?  -mod ]
  1396.  
  1397. --keith
  1398. ======================================================================
  1399.  
  1400. #include <stdio.h>
  1401.  
  1402. /*
  1403.  * this is a public domain version of getopt(3).
  1404.  * bugs, fixes to:
  1405.  *        Keith Bostic
  1406.  *            ARPA: keith@seismo
  1407.  *            UUCP: seismo!keith
  1408.  */
  1409.  
  1410. /*
  1411.  * get option letter from argument vector
  1412.  */
  1413. int    opterr = 1,        /* useless, never set or used */
  1414.     optind = 1,        /* index into parent argv vector */
  1415.     optopt;            /* character checked for validity */
  1416. char    *optarg;        /* argument associated with option */
  1417.  
  1418. #define BADCH    (int)'?'
  1419. #define EMSG    ""
  1420. #define tell(s)    fputs(*nargv,stderr);fputs(s,stderr); \
  1421.         fputc(optopt,stderr);fputc('\n',stderr);return(BADCH);
  1422.  
  1423. getopt(nargc,nargv,ostr)
  1424. int    nargc;
  1425. char    **nargv,
  1426.     *ostr;
  1427. {
  1428.     static char    *place = EMSG;    /* option letter processing */
  1429.     register char    *oli;        /* option letter list index */
  1430.     char    *index();
  1431.  
  1432.     if(!*place) {            /* update scanning pointer */
  1433.         if(optind >= nargc || *(place = nargv[optind]) != '-' || !*++place) return(EOF);
  1434.         if (*place == '-') {    /* found "--" */
  1435.             ++optind;
  1436.             return(EOF);
  1437.         }
  1438.     }                /* option letter okay? */
  1439.     if ((optopt = (int)*place++) == (int)':' || !(oli = index(ostr,optopt))) {
  1440.         if(!*place) ++optind;
  1441.         tell(": illegal option -- ");
  1442.     }
  1443.     if (*++oli != ':') {        /* don't need argument */
  1444.         optarg = NULL;
  1445.         if (!*place) ++optind;
  1446.     }
  1447.     else {                /* need an argument */
  1448.         if (*place) optarg = place;    /* no white space */
  1449.         else if (nargc <= ++optind) {    /* no arg */
  1450.             place = EMSG;
  1451.             tell(": option requires an argument -- ");
  1452.         }
  1453.          else optarg = nargv[optind];    /* white space */
  1454.         place = EMSG;
  1455.         ++optind;
  1456.     }
  1457.     return(optopt);            /* dump back option letter */
  1458. }
  1459.  
  1460. -- 
  1461.  
  1462. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  1463. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  1464.  
  1465. Volume-Number: Volume 1, Number 14
  1466.  
  1467. From jsq  Mon Jul  8 15:00:21 1985
  1468. Path: ut-sally!jsq
  1469. From: jsq@ut-sally.UUCP (John Quarterman)
  1470. Newsgroups: mod.std.unix
  1471. Subject: guest moderator
  1472. Message-Id: <2301@ut-sally.UUCP>
  1473. Date: 8 Jul 85 20:00:16 GMT
  1474. Reply-To: std-unix-request@ut-sally
  1475. Organization: U. Texas CS Dept., Austin, Texas
  1476. Lines: 17
  1477. Approved: jsq@ut-sally.UUCP
  1478. Draft-9: mod.std.unix
  1479.  
  1480. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  1481.  
  1482. Since I'm going to be out of town from Tuesday, 9 July through
  1483. Sunday, 14 July, there will be a guest moderator this week.
  1484. He's John B. Chambers of MCC, who was co-author of the
  1485. "UNIX System V and 4.1C BSD" paper which was a main reason
  1486. the USENIX board picked on me, so it's only appropriate that
  1487. he have to pay, er, *help*, too.
  1488.  
  1489. Mail to ut-sally!std-unix and ut-sally!std-unix-request will
  1490. go to both me and jbc.  Mail to ut-sally!jsq will just sit around
  1491. in my mailbox until I get back, so it's best to mail to one
  1492. of the above aliases.
  1493. -- 
  1494.  
  1495. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  1496. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  1497.  
  1498. Volume-Number: Volume 1, Number 15
  1499.  
  1500. From uucp@ut-sally.UTEXAS.ARPA Sun Jul 14 19:54:12 1985
  1501. Path: ut-sally!mcc-db!jbc
  1502. From: mcc-db!jbc (John B. Chambers)
  1503. Newsgroups: mod.std.unix
  1504. Subject: Re: command line arguments
  1505. Message-Id: <244@mcc-db.UUCP>
  1506. Date: 14 Jul 85 23:56:19 GMT
  1507. References: <2210@ut-sally.UUCP>
  1508. Reply-To: std-unix-request@ut-sally
  1509. Organization: MCC (Austin, TX)
  1510. Lines: 35
  1511. Approved: jbc@mcc-db.UUCP
  1512. Draft-9: 1003.2.getopt
  1513.  
  1514. From: John Chambers (guest moderator) <ut-sally!std-unix>
  1515.  
  1516. Topic: getopts (command line arguments) continued
  1517.  
  1518. ----------------------------------------------------------------------
  1519.  
  1520. Date: Mon, 8 Jul 85 14:41:54 PDT
  1521. From: UCLA Computer Club <cc1@UCLA-LOCUS.ARPA>
  1522. Subject: Re: command line arguments
  1523.  
  1524. Regarding getopts and the 'all arguments are proceded by a "-"':
  1525. What about arguments that can be on/off switches, or can be positive or
  1526. negative numbers? In other words, what is wrong with allowing '+' as an
  1527. indicator of arguments? There are some commands that use it already.
  1528.  
  1529. Incidently, what happens with getopts if the command line was
  1530. command -n -30
  1531. and:
  1532. Option n is fetched
  1533. option 3 is fetched
  1534. option 0 is fetched
  1535.  
  1536. (No well written program would do all this, but essentially, what happens
  1537. if an argument looks like a flag? Or have you never grep'ed for a string
  1538. beginning with -?)
  1539.  
  1540. ----------------------------------------------------------------------
  1541.  
  1542. -- 
  1543.  
  1544. John B. Chambers, Microelectronics and Computer Technology Corp., Austin, TX
  1545. {ihnp4,seismo,ctvax}!ut-sally!mcc-db!jbc, jbc@ut-sally.ARPA, chambers@mcc.ARPA
  1546.  
  1547. Volume-Number: Volume 1, Number 16
  1548.  
  1549. From uucp@ut-sally.UTEXAS.ARPA Sun Jul 14 19:55:00 1985
  1550. Path: ut-sally!mcc-db!jbc
  1551. From: mcc-db!jbc (John B. Chambers)
  1552. Newsgroups: mod.std.unix
  1553. Subject: Re: command line arguments
  1554. Message-Id: <246@mcc-db.UUCP>
  1555. Date: 14 Jul 85 23:56:26 GMT
  1556. Reply-To: std-unix-request@ut-sally
  1557. Organization: MCC (Austin, TX)
  1558. Lines: 51
  1559. Approved: jbc@mcc-db.UUCP
  1560. Draft-9: 1003.2.getopt
  1561.  
  1562. From: John Chambers (guest moderator) <ut-sally!std-unix>
  1563.  
  1564. Topic: command line arguments continued
  1565.  
  1566. ----------------------------------------------------------------------
  1567.  
  1568. Date: 8 Jul 85 23:23:03 CDT (Mon)
  1569. From: ihnp4!utzoo!henry@ut-sally.ARPA
  1570. Subject: Re: command line arguments
  1571.  
  1572. > I doubt the necessity and even the wisdom of seperating an argument from
  1573. > the option by whitespace.
  1574.  
  1575. As I recall it, the AT&T standard does it this way on the grounds of
  1576. readability, not necessity.  The "-t/dev/tty" example is an easy one
  1577. to pick out, but what about "-dfaglop"?  Which of those letters are
  1578. options, and which are an option argument?
  1579.  
  1580. > I also dislike the blackballing of multicharacter options.
  1581.  
  1582. Unfortunately, they are seriously incompatible with one-character options
  1583. and option bundling, both of which are too firmly entrenched to be changed
  1584. at this late date.  There were earlier attempts within AT&T to change
  1585. the world by legislating a different way of doing things; you don't hear
  1586. about them because they were failures.  People ignored them.  Getopt and
  1587. the option standard have the virtue of being pretty much compatible with
  1588. the bulk of present practice, which makes it far more likely that they
  1589. will be *adopted*.
  1590.  
  1591. > As for multicharater options: do you intend to kill "tail -30"? Since
  1592. > changing the number of lines is the most common case what's the problem?
  1593. > At any rate you should allow a simple '-nnn' for a high-usage.
  1594.  
  1595. The AT&T people admit that existing high-usage programs cannot be changed
  1596. retroactively.  This is a blemish rather than a disaster.  I tend to agree
  1597. that "-nnn" would be nice to have, but am not excited enough about it to
  1598. fight a battle over it.
  1599.  
  1600.                 Henry Spencer @ U of Toronto Zoology
  1601.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  1602.  
  1603.  
  1604.  
  1605. ----------------------------------------------------------------------
  1606.  
  1607. -- 
  1608.  
  1609. John B. Chambers, Microelectronics and Computer Technology Corp., Austin, TX
  1610. {ihnp4,seismo,ctvax}!ut-sally!mcc-db!jbc, jbc@ut-sally.ARPA, chambers@mcc.ARPA
  1611.  
  1612. Volume-Number: Volume 1, Number 17
  1613.  
  1614. From uucp@ut-sally.UTEXAS.ARPA Sun Jul 14 20:36:16 1985
  1615. Path: ut-sally!mcc-db!jbc
  1616. From: mcc-db!jbc (John B. Chambers)
  1617. Newsgroups: mod.std.unix
  1618. Subject: What to do about extraneous arguments?
  1619. Message-Id: <251@mcc-db.UUCP>
  1620. Date: 14 Jul 85 23:56:42 GMT
  1621. Reply-To: std-unix-request@ut-sally
  1622. Organization: MCC (Austin, TX)
  1623. Lines: 38
  1624. Approved: jbc@mcc-db.UUCP
  1625. Draft-9: 1003.2.getopt
  1626.  
  1627. From: John Chambers (guest moderator) <ut-sally!std-unix>
  1628.  
  1629. Topic: command line arguments continued
  1630.  
  1631. ----------------------------------------------------------------------
  1632.  
  1633. From: ihnp4!tektronix!uucp@ut-sally.ARPA
  1634. Date: Saturday, 13 Jul 85 18:43:47 PDT
  1635. Subject: What to do about extraneous arguments?
  1636.  
  1637. Another aspect of command arguments is: after all the necessary arguments
  1638. have been processed, what if some are left?
  1639.  
  1640. Some commands process the whole list, and are intended to do so (e.g.
  1641. ls(1)).  Others (e.g. diff(1), cmp(1)) only work on a specific number
  1642. of arguments.
  1643.  
  1644. Common practice seems to be to ignore extraneous arguments.  A user here
  1645. has requested that cmp(1) be modified to generate a diagnostic if more
  1646. than 2 filenames are provided.  This might be helpful when using wildcards
  1647. for filenames, as in:
  1648.  
  1649.     cmp foo* fum*
  1650.  
  1651. If there is more than one file matching 'foo*' and you don't realize it,
  1652. the results are not what you expect.  Comments?
  1653.  
  1654. tektronix!rdoty
  1655.  
  1656.  
  1657. ----------------------------------------------------------------------
  1658.  
  1659. -- 
  1660.  
  1661. John B. Chambers, Microelectronics and Computer Technology Corp., Austin, TX
  1662. {ihnp4,seismo,ctvax}!ut-sally!mcc-db!jbc, jbc@ut-sally.ARPA, chambers@mcc.ARPA
  1663.  
  1664. Volume-Number: Volume 1, Number 18
  1665.  
  1666. From uucp@ut-sally.UTEXAS.ARPA Sun Jul 14 20:37:12 1985
  1667. Path: ut-sally!mcc-db!jbc
  1668. From: mcc-db!jbc (John B. Chambers)
  1669. Newsgroups: mod.std.unix
  1670. Subject: getopt bundling brouhaha
  1671. Message-Id: <248@mcc-db.UUCP>
  1672. Date: 14 Jul 85 23:56:32 GMT
  1673. Reply-To: std-unix-request@ut-sally
  1674. Organization: MCC (Austin, TX)
  1675. Lines: 37
  1676. Approved: jbc@mcc-db.UUCP
  1677. Draft-9: 1003.2.getopt
  1678.  
  1679. From: John Chambers (guest moderator) <ut-sally!std-unix>
  1680.  
  1681. Topic: getopt and command line arguments continued
  1682.  
  1683. ----------------------------------------------------------------------
  1684.  
  1685. Date: Wed, 10 Jul 85 09:53:45 EDT
  1686. From: seismo!elsie!ado@ut-sally.ARPA
  1687. Subject: getopt bundling brouhaha
  1688.  
  1689. Why all this brouhaha over whether or not getopt should allow option arguments
  1690. to be bundled with option names?  Let each user decide! People who wanted to
  1691. bundle could place commands such as
  1692.  
  1693.     GETOPT=b
  1694.     export GETOPT
  1695.  
  1696. in their login command files; getopt could check the GETOPT environment
  1697. variable to see if it contained a 'b' and allow bundling if it did.
  1698.  
  1699. This method could be used to give users control over other aspects of
  1700. getopt's behavior (whether to be sensitive to the case of option names;
  1701. whether to recognize options anywhere on the command line; and so on).
  1702. --
  1703.     UUCP: ..decvax!seismo!elsie!ado    ARPA: elsie!ado@seismo.ARPA
  1704.     DEC, VAX and Elsie are Digital Equipment and Borden trademarks
  1705.  
  1706.  
  1707.  
  1708. ----------------------------------------------------------------------
  1709.  
  1710. -- 
  1711.  
  1712. John B. Chambers, Microelectronics and Computer Technology Corp., Austin, TX
  1713. {ihnp4,seismo,ctvax}!ut-sally!mcc-db!jbc, jbc@ut-sally.ARPA, chambers@mcc.ARPA
  1714.  
  1715. Volume-Number: Volume 1, Number 19
  1716.  
  1717. From uucp@ut-sally.UTEXAS.ARPA Sun Jul 14 20:38:21 1985
  1718. Path: ut-sally!mcc-db!jbc
  1719. From: mcc-db!jbc (John B. Chambers)
  1720. Newsgroups: mod.std.unix
  1721. Subject: Re: curses, terminfo, and termcap
  1722. Message-Id: <247@mcc-db.UUCP>
  1723. Date: 14 Jul 85 23:56:29 GMT
  1724. References: <2257@ut-sally.UUCP>, <2294@ut-sally.UUCP>
  1725. Reply-To: std-unix-request@ut-sally
  1726. Organization: MCC (Austin, TX)
  1727. Lines: 46
  1728. Approved: jbc@mcc-db.UUCP
  1729. Draft-9: curses
  1730.  
  1731. From: John Chambers (guest moderator) <ut-sally!std-unix>
  1732.  
  1733. Topic: curses, terminfo, termcap
  1734.  
  1735. ----------------------------------------------------------------------
  1736.  
  1737. Date: 10 Jul 85 00:15:09 CDT (Wed)
  1738. From: ihnp4!utzoo!henry@ut-sally.ARPA
  1739. Subject: Re: curses, terminfo, and termcap
  1740.  
  1741. > What I think is important about curses is not the code that implements
  1742. > it (although this code was hard and it shouldn't have to be done more
  1743. > than once) but the interface between the program and the package.
  1744. > Curses is intended as a way to write portable screen oriented applications.
  1745. > ...
  1746. > I personally would like to see curses (or some appripriate subset) become
  1747. > part of the C standard, along with Standard I/O.  However, it appears that
  1748. > the committee is not planning to do this.  Lacking this, I would like to
  1749. > see it become part of a UNIX standard.
  1750.  
  1751. One might argue (and on Mondays, Wednesdays, and Fridays I would) that a
  1752. standard screen-handling package ought to be oriented towards display of
  1753. text rather than video games.  Unless I have missed something -- I am not
  1754. all that familiar with curses -- when I insert a line in the middle of my
  1755. "screen", curses essentially has to rediscover this by comparing characters.
  1756. This seems silly; surely higher-level primitives would be better for most
  1757. situations.  (Rogue is a different story, of course.)
  1758.  
  1759. Something like the "FastAlpha" package described by HP a couple of Usenixes
  1760. ago would be a much better match to text-oriented screen handling, which I
  1761. would guess describes the majority of non-game curses applications.  Alas,
  1762. curses is already pretty well established; it may be too late to change.
  1763.  
  1764.                 Henry Spencer @ U of Toronto Zoology
  1765.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  1766.  
  1767.  
  1768.  
  1769. ----------------------------------------------------------------------
  1770.  
  1771. -- 
  1772.  
  1773. John B. Chambers, Microelectronics and Computer Technology Corp., Austin, TX
  1774. {ihnp4,seismo,ctvax}!ut-sally!mcc-db!jbc, jbc@ut-sally.ARPA, chambers@mcc.ARPA
  1775.  
  1776. Volume-Number: Volume 1, Number 20
  1777.  
  1778. From uucp@ut-sally.UTEXAS.ARPA Sun Jul 14 20:46:03 1985
  1779. Path: ut-sally!mcc-db!jbc
  1780. From: mcc-db!jbc (John B. Chambers)
  1781. Newsgroups: mod.std.unix
  1782. Subject: Re;  bostic's getopt
  1783. Message-Id: <249@mcc-db.UUCP>
  1784. Date: 14 Jul 85 23:56:36 GMT
  1785. Reply-To: std-unix-request@ut-sally
  1786. Organization: MCC (Austin, TX)
  1787. Lines: 145
  1788. Approved: jbc@mcc-db.UUCP
  1789. Draft-9: 1003.2.getopt
  1790.  
  1791. From: John Chambers (guest moderator) <ut-sally!std-unix>
  1792.  
  1793. Topic: getopt and command line arguments continued
  1794.  
  1795. ----------------------------------------------------------------------
  1796.  
  1797. Date: Wed, 10 Jul 85 15:14:05 edt
  1798. From: harvard!talcott!wjh12!mirror!rs@ut-sally.ARPA (Rich Salz)
  1799. Subject: Re;  bostic's getopt
  1800.  
  1801.  
  1802. I have modified Keith Bostic's getopt code to make three changes:
  1803.     1.  my own (warped) esthetics.
  1804.     2.  add non-stdio code compile-time flag.
  1805.     3.  add trivial code to handle the opterr variable.
  1806. This last change is the most important; opterr, if set to 0 in
  1807. mainline code, suppresses printing all error messages.
  1808.  
  1809. i also cleaned up a couple of things.
  1810.  
  1811. feel free to re-post this to std-unix, or even {net,mod}.sourceds
  1812. if you think it will be worthwhile...
  1813.  
  1814. --
  1815. Rich $alz    {mit-eddie, ihnp4!inmet, wjh12, cca, datacube} !mirror!rs
  1816. Mirror Systems    2067 Massachusetts Ave.
  1817. 617-661-0777    Cambridge, MA, 02140
  1818.  
  1819. /*
  1820. **  This is a public domain version of getopt(3).
  1821. **  Bugs, fixes to:
  1822. **        Keith Bostic
  1823. **            ARPA: keith@seismo
  1824. **            UUCP: seismo!keith
  1825. **  Added NO_STDIO, opterr handling, Rich $alz (mirror!rs).
  1826. */
  1827.  
  1828. #include <stdio.h>
  1829.  
  1830. /*
  1831. **  Error macro.  Maybe we want stdio, maybe we don't.
  1832. **  The (undocumented?) variable opterr tells us whether or not
  1833. **  to print errors.
  1834. */
  1835.  
  1836. #ifdef    NO_STDIO
  1837.  
  1838. #define tell(s)                                \
  1839.     if (opterr)                            \
  1840.     {                                \
  1841.         char    ebuf[2];                    \
  1842.         (void)write(2, nargv, (unsigned int)strlen(nargv));        \
  1843.         (void)write(2, s, (unsigned int)strlen(s));            \
  1844.         ebuf[0] = optopt;                        \
  1845.         ebuf[1] = '\n';                        \
  1846.         (void)write(2, ebuf, 2);                    \
  1847.     }
  1848.  
  1849. #else
  1850.  
  1851. #define tell(s)                                \
  1852.     if (opterr)                            \
  1853.         (void)fputs(*nargv, stderr),                \
  1854.         (void)fputs(s,stderr),                    \
  1855.         (void)fputc(optopt, stderr),                \
  1856.         (void)fputc('\n', stderr)
  1857.  
  1858. #endif
  1859.  
  1860.  
  1861. /* Global variables. */
  1862. static char     EMSG[] = "";
  1863. int         opterr = 1;        /* undocumented error-suppressor*/
  1864. int         optind = 1,        /* index into argv vector    */
  1865. int         optopt;        /* char checked for validity    */
  1866. char        *optarg;        /* arg associated with option    */
  1867.  
  1868.  
  1869. /* Linked in later. */
  1870. extern char    *index();        /* This may be strchr        */
  1871.  
  1872.  
  1873. getopt(nargc, nargv, ostr)
  1874.     int              nargc;
  1875.     char        **nargv;
  1876.     char         *ostr;
  1877. {
  1878.     static char         *place = EMSG;    /* option letter processing    */
  1879.     register char     *oli;        /* option letter list index    */
  1880.  
  1881.     if (!*place)            /* update scanning pointer    */
  1882.     {
  1883.     if (optind >= nargc || *(place = nargv[optind]) != '-' || !*++place)
  1884.         return(EOF);
  1885.     if (*place == '-')        /* found "--"            */
  1886.     {
  1887.         optind++;
  1888.         return(EOF);
  1889.     }
  1890.     }
  1891.     /* option letter okay? */
  1892.     if ((optopt = *place++) == ':' || (oli = index(ostr, optopt)) == NULL)
  1893.     {
  1894.     if (!*place)
  1895.         optind++;
  1896.     tell(": illegal option -- ");
  1897.     goto Bad;
  1898.     }
  1899.     if (*++oli != ':')            /* don't need argument        */
  1900.     {
  1901.     optarg = NULL;
  1902.     if (!*place)
  1903.         optind++;
  1904.     }
  1905.     else                /* need an argument        */
  1906.     {
  1907.     if (*place)
  1908.         optarg = place;        /* no white space        */
  1909.     else
  1910.         if (nargc <= ++optind)
  1911.         {
  1912.         place = EMSG;
  1913.         tell(": option requires an argument -- ");
  1914.         goto Bad;
  1915.         }
  1916.         else
  1917.         optarg = nargv[optind];    /* white space            */
  1918.     place = EMSG;
  1919.     optind++;
  1920.     }
  1921.     return(optopt);            /* dump back option letter    */
  1922. Bad:
  1923.     return('?');
  1924. }
  1925.  
  1926.  
  1927.  
  1928. ----------------------------------------------------------------------
  1929.  
  1930. -- 
  1931.  
  1932. John B. Chambers, Microelectronics and Computer Technology Corp., Austin, TX
  1933. {ihnp4,seismo,ctvax}!ut-sally!mcc-db!jbc, jbc@ut-sally.ARPA, chambers@mcc.ARPA
  1934.  
  1935. Volume-Number: Volume 1, Number 21
  1936.  
  1937. From uucp@ut-sally.UTEXAS.ARPA Sun Jul 14 20:46:59 1985
  1938. Path: ut-sally!mcc-db!jbc
  1939. From: mcc-db!jbc (John B. Chambers)
  1940. Newsgroups: mod.std.unix
  1941. Subject: getopt(3) (again...)
  1942. Message-Id: <250@mcc-db.UUCP>
  1943. Date: 14 Jul 85 23:56:38 GMT
  1944. Reply-To: std-unix-request@ut-sally
  1945. Organization: MCC (Austin, TX)
  1946. Lines: 87
  1947. Approved: jbc@mcc-db.UUCP
  1948. Draft-9: 1003.2.getopt
  1949.  
  1950. From: John Chambers (guest moderator) <ut-sally!std-unix>
  1951.  
  1952. Topic: getopt (command line arguments) continued
  1953.  
  1954. ----------------------------------------------------------------------
  1955.  
  1956. Date: Thu, 11 Jul 85 14:07:41 EDT
  1957. From: Keith Bostic <keith@seismo.CSS.GOV>
  1958. Subject: getopt(3) (again...)
  1959.  
  1960.  
  1961. Just when I thought it was safe to read my mail...
  1962.  
  1963. > i made a couple of changes.  esthetics, absolutely no stdio if
  1964. > desired, and the opterr variable.  here's my revision:
  1965.  
  1966. I'm getting pretty tired of this whole issue -- in fact, I kept starting
  1967. to reply to your mail and then deciding not to, figuring that if I didn't
  1968. maybe the whole thing would die off.  *sigh*  Well, my friend, here's
  1969. a reply.  The content is simple.  You are wrong.  Pure-d, absolutely,
  1970. wrong.
  1971.  
  1972. Point by point:
  1973.  
  1974. esthetics:
  1975.     Esthetics are all very well and good, and we could argue for the next
  1976. several days as to whether a goto can be considered esthetical, or whether
  1977. indentation should be 4 characters or 8, or whether "void" is really a good
  1978. idea, or if "index()" *really* needs to be declared outside of the local
  1979. routine, etc. etc. until the cows return from pasture.  On the other hand,
  1980. 4.3BSD is going to use my code.  Since it works, I see no value in making
  1981. the wheel ever so slightly rounder, if, in fact, you managed to do so.  I do
  1982. not wish to spend the rest of my life figuring out that some getopt really
  1983. does work.  I would like to assume that the one that comes with 4.3 does work
  1984. and I can therefore turn my attention to other parts of an ailing program,
  1985. after doing a very brief "diff" of the two modules.  The world does not need
  1986. another getopt.  When I re-wrote the one I did, it did.
  1987.  
  1988. absolutely no stdio if desired:
  1989.     Well, for an error condition that's going to happen once before the
  1990. program exits, it's gonna be faster.  You saved about 2 routine calls, near
  1991. as I can figure.  You didn't save any library space, which is why I changed
  1992. the original fprintf() calls to fputs() calls.
  1993.  
  1994. the opterr variable:
  1995.     The other two items, I could live with.  Here, on the other hand,
  1996. you have single-handedly created a real pain in the ass in terms of
  1997. portability.
  1998.  
  1999. Scenario #1:
  2000.     Bell Labs doesn't ever decide to use opterr.  Fine and dandy,
  2001.     except that people who use your new flag will find that their
  2002.     code will not run as expected on USG UNIX.
  2003.  
  2004. Scenario #2:
  2005.     USG uses the flag, but makes it backward compatible.  Well, little
  2006.     problem here, BSD code will now not run on USG machines which is
  2007.     the situation we had before we wrote the damn thing.
  2008.  
  2009. Scenario #3:
  2010.     USG uses the flag, but doesn't make it backward compatible.
  2011.     Unlikely, but possible.  Well, we change getopt(3) to be like
  2012.     Bell, breaking all of the code that has been written to use your
  2013.     new flag, or, of course, we could just diverge the two systems
  2014.     again.  Fun, fun!
  2015.  
  2016. As it is (or was, before this new edition) we just change to use USG's
  2017. new opterr behaviors and go on as before, unless they don't make it
  2018. backward compatible, in which case the entire UNIX world is in the same
  2019. boat.
  2020.  
  2021. I would have been much more amenable to changes two months ago; if you
  2022. can get Mike Karels to use your version rather than mine, I will again
  2023. be much more amenable to changes.  Well, with the exception of your use
  2024. of opterr.
  2025.  
  2026. --keith
  2027.  
  2028.  
  2029. ----------------------------------------------------------------------
  2030.  
  2031. -- 
  2032.  
  2033. John B. Chambers, Microelectronics and Computer Technology Corp., Austin, TX
  2034. {ihnp4,seismo,ctvax}!ut-sally!mcc-db!jbc, jbc@ut-sally.ARPA, chambers@mcc.ARPA
  2035.  
  2036. Volume-Number: Volume 1, Number 22
  2037.  
  2038. From uucp@ut-sally.UTEXAS.ARPA Sun Jul 14 20:48:02 1985
  2039. Path: ut-sally!mcc-db!jbc
  2040. From: mcc-db!jbc (John B. Chambers)
  2041. Newsgroups: mod.std.unix
  2042. Subject: Re: command line arguments
  2043. Message-Id: <245@mcc-db.UUCP>
  2044. Date: 14 Jul 85 23:56:22 GMT
  2045. Reply-To: std-unix-request@ut-sally
  2046. Organization: MCC (Austin, TX)
  2047. Lines: 155
  2048. Approved: jbc@mcc-db.UUCP
  2049. Draft-9: 1003.2.getopt
  2050.  
  2051. From: John Chambers (guest moderator) <ut-sally!std-unix>
  2052.  
  2053. Topic: command line arguments
  2054.  
  2055. ----------------------------------------------------------------------
  2056.  
  2057. Date: Mon, 8 Jul 85 00:52:46 pdt
  2058. From: nsc!turtlevax!ken@ihnp4.UUCP (Ken Turkowski)
  2059. Subject: Re: command line arguments
  2060.  
  2061. Someone suggested that parsing arguments in shell scripts was difficult.
  2062. I include the following shell scripts, one for the Bourne shell and one
  2063. for the C-shell, which parse arguments of the form:
  2064.     -v -O -o outfile file1 file2 file3
  2065. as well as
  2066.     -vOooutfile file1 file2 file3
  2067.  
  2068. =================================================================
  2069.  
  2070. # This is a shell archive.  Remove anything before this line, then
  2071. # unpack it by saving it in a file and typing "sh file".  (Files
  2072. # unpacked will be owned by you and have default permissions.)
  2073. #
  2074. # This archive contains:
  2075. # std.sh std.csh
  2076.  
  2077. echo x - std.sh
  2078. cat > "std.sh" << '//E*O*F std.sh//'
  2079. #! /bin/sh
  2080. PATH=/usr/ucb:/bin:/usr/bin:/usr/local/bin
  2081. verbose=false
  2082. files=
  2083. trap 'rm $temp_files; exit' 0 1 2
  2084. for arg            # Look for flags
  2085. do    while true
  2086.     do    case $arg in
  2087.         -\?|-help) cat << EOF
  2088. This shell script accepts the arguments:
  2089.     -v        Verbose
  2090.     -o <outfile>    Output directed to <outfile> instead of default
  2091.     <file> ...    Files to be processed
  2092. It parses the arguments and prints the results of the parse.
  2093. EOF
  2094.             exit ;;
  2095.         -)    echo NULL FLAG; break ;;
  2096.         -v*)    verbose=true ;;
  2097.         -o*)    outfile=`expr $arg : '-.\(.*\)'` || outfile=UNKNOWN
  2098.             break ;;
  2099.         -*)    echo Unknown flag: \"$arg\"
  2100.             unkflag="$unkflag $arg"
  2101.             break ;;
  2102.         *)    case UNKNOWN in
  2103.             $outfile)    outfile=$arg ;;
  2104.             *)        files="$files $arg" ;;
  2105.             esac
  2106.             break ;;
  2107.         esac
  2108.         arg=-`expr "$arg" : '-.\(.*\)'` || break
  2109.     done
  2110. done
  2111.  
  2112. set x $files
  2113. shift
  2114. for arg        # input file processing template
  2115. do
  2116.     echo processing file \"$arg\"
  2117. done
  2118.  
  2119. # The following is just for testing this standard script
  2120. echo '
  2121. Argument' analysis to $0:
  2122. echo Flags: -v = $verbose, -o = \"$outfile\"
  2123. echo Unknown flags: $unkflag
  2124. echo Files: $files
  2125. //E*O*F std.sh//
  2126.  
  2127. echo x - std.csh
  2128. cat > "std.csh" << '//E*O*F std.csh//'
  2129. #! /bin/csh -f
  2130. unalias *
  2131. set path = (/usr/ucb /bin /usr/bin /usr/local/bin)
  2132. unset Verbose
  2133. set temp_files=
  2134. set outfile
  2135. set unkflag
  2136. set files
  2137. onintr cleanup
  2138. foreach argument ( $*:q )
  2139.     while ( 1 )
  2140.         switch ( "$argument" )
  2141.         case -[?]:
  2142.         case -help:
  2143.         cat << EOF
  2144. This shell script take the arguments:
  2145.     -v        Verbose
  2146.     -o <outfile>    Change output file to <outfile> instead of the default.
  2147.     -? or -help    Prints this help message
  2148.     <file> ...    Input files
  2149. It parses them and prints the result of the parse.
  2150. EOF
  2151.         exit
  2152.             case -:
  2153.                 echo 'NULL FLAG'
  2154.                 break
  2155.             case -v*:
  2156.         set Verbose 
  2157.         breaksw
  2158.             case -o*:    
  2159.                 set outfile = `expr $argument : '-.\(.*\)'` || set outfile = UNKNOWN
  2160.                 break
  2161.             case -*:    
  2162.                 echo Unknown flag: \""$argument"\"
  2163.                 set unkflag = "$unkflag $argument"
  2164.                 break
  2165.             case *:    
  2166.                 switch ( UNKNOWN )
  2167.                     case "$outfile":
  2168.             set outfile = $argument
  2169.             breaksw
  2170.                     default:        
  2171.             set files = "$files $argument" 
  2172.                 endsw
  2173.                 break
  2174.         endsw
  2175.         set argument = -`expr "$argument" : '-.\(.*\)'` || break
  2176.     end
  2177. end
  2178.  
  2179. # The following is just for testing this standard script
  2180. echo ' Argument analysis to' $0 ':'
  2181. echo Flags: -v = ${?Verbose}, -o = \"$outfile\"
  2182. echo Unknown flags: $unkflag
  2183. echo Files: $files
  2184.  
  2185. cleanup:
  2186.     rm $temp_files
  2187. exit
  2188. //E*O*F std.csh//
  2189.  
  2190. exit 0
  2191. -- 
  2192.  
  2193. Ken Turkowski @ CADLINC, Menlo Park, CA
  2194. UUCP: {amd,decwrl,hplabs,nsc,seismo,spar}!turtlevax!ken
  2195. ARPA: turtlevax!ken@DECWRL.ARPA
  2196.  
  2197.  
  2198. ----------------------------------------------------------------------
  2199.  
  2200. -- 
  2201.  
  2202. John B. Chambers, Microelectronics and Computer Technology Corp., Austin, TX
  2203. {ihnp4,seismo,ctvax}!ut-sally!mcc-db!jbc, jbc@ut-sally.ARPA, chambers@mcc.ARPA
  2204.  
  2205. Volume-Number: Volume 1, Number 23
  2206.  
  2207. From jsq  Tue Jul 16 14:35:27 1985
  2208. Path: ut-sally!jsq
  2209. From: jsq@ut-sally.UUCP (John Quarterman)
  2210. Newsgroups: mod.std.unix
  2211. Subject: a bit more on getopt
  2212. Message-Id: <2365@ut-sally.UUCP>
  2213. Date: 16 Jul 85 19:35:20 GMT
  2214. References: <251@mcc-db.UUCP>
  2215. Reply-To: std-unix@ut-sally
  2216. Organization: U. Texas CS Dept., Austin, Texas
  2217. Lines: 116
  2218. Keywords: option parsing, command line arguments
  2219. Approved: jsq@ut-sally.UUCP
  2220. Summary: we've pretty much covered this subject
  2221. Draft-9: 1003.2.getopt
  2222.  
  2223. From: John Quarterman <std-unix-request@ut-sally.UUCP> (moderator)
  2224. Topic: command line arguments (getopt)
  2225.  
  2226. There's getting to be a bit of repetition and a certain amount of
  2227. flamage on this subject.  Several things seem clear to me, at least:
  2228.  
  2229. 1) Keith Bostic's getopt is the de facto standard public domain getopt
  2230.     because a) it implements everything the System V one does,
  2231.     down to specific error messages and global variables, and
  2232.     b) it's going to be in 4.3BSD.  It also may or may not be
  2233.     more efficient or smaller when seen in perspective.
  2234. 2) Henry Spencer's getopt, in the version that I posted that Ian Darwin
  2235.     sent, is just about as good, since its earlier bug is fixed,
  2236.     though it lacks some undocumented System V features which
  2237.     Bostic's includes.
  2238. 3) There are numerous minor functional changes which might be desirable
  2239.     for one reason or another, but they would *be* changes, and are
  2240.     not in the "standard" getopt.  The existing getopt is good
  2241.     enough for most purposes, and is widely available:  there is
  2242.     no need for another implementation.
  2243.  
  2244. While these are my personal opinions, they appear to agree with
  2245. those of the two getopt authors mentioned above.  Since I have
  2246. to go by something in moderating the newsgroup, I will discourage
  2247. from now on submissions which merely argue the above points again.
  2248. In other words, let's try to think of something new to say, or
  2249. go on to something else.
  2250.  
  2251.  
  2252. ----------------------------------------------------------------------
  2253.  
  2254. From: ihnp4!utzoo!henry (Henry Spencer)
  2255. Date: 15 Jul 85 16:10:12 CDT (Mon)
  2256. To: ihnp4!ut-sally!std-unix
  2257. Subject: Re: What to do about extraneous arguments?
  2258. References: <251@mcc-db.UUCP>
  2259.  
  2260. > Common practice seems to be to ignore extraneous arguments.  A user here
  2261. > has requested that cmp(1) be modified to generate a diagnostic if more
  2262. > than 2 filenames are provided.  ...
  2263.  
  2264. The standard program skeleton for using getopt(3) includes, after the
  2265. big while-switch for the options, the code:
  2266.  
  2267.     if (errflg) {
  2268.         fprintf(stderr, "Usage: ...\n");
  2269.         exit(2);
  2270.     }
  2271.  
  2272. It's pretty simple to change that "if (errflg) {" to something like
  2273. "if (errflg || optind+2 != argc) {".  This is what we do in such cases.
  2274. Easy and effective.
  2275.                 Henry Spencer @ U of Toronto Zoology
  2276.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  2277.  
  2278. ------------------------------
  2279.  
  2280. From: ihnp4!utzoo!henry (Henry Spencer)
  2281. Date: 15 Jul 85 16:09:35 CDT (Mon)
  2282. To: ihnp4!ut-sally!std-unix
  2283. Subject: Re: command line arguments
  2284. References: <2210@ut-sally.UUCP>, <244@mcc-db.UUCP>
  2285.  
  2286. > Regarding getopts and the 'all arguments are proceded by a "-"':
  2287. > What about arguments that can be on/off switches, or can be positive or
  2288. > negative numbers? In other words, what is wrong with allowing '+' as an
  2289. > indicator of arguments? There are some commands that use it already.
  2290.  
  2291. The AT&T people considered this.  (It would be nice to see a posting of
  2292. the AT&T paper, in fact, if someone has it machine-readable [I don't]
  2293. [ I don't either, but if someone would mail it to me, I would post it
  2294. (if it's reasonably short) -mod ]; it would shorten this discussion
  2295. considerably.)  They thought the following were reasonable criteria for
  2296. accepting + :
  2297.  
  2298. 1. Clear, simple, well-defined rules for when + should be used.
  2299. 2. Rules should be applicable to more than just a few atypical commands.
  2300. 3. Use of + should complement, not conflict with, the general use of -
  2301.     as an option marker (*not* as a "negation" indicator, note).
  2302.  
  2303. Their observations were that the existing uses of + meet none of these
  2304. criteria, that compatibility would prevent cleaning up existing uses,
  2305. and that criterion #3 seemed impossible to satisfy.  So, no +.
  2306.  
  2307. > Incidently, what happens with getopts if the command line was
  2308. > command -n -30
  2309. > and:
  2310. > Option n is fetched
  2311. > option 3 is fetched
  2312. > option 0 is fetched
  2313. > (No well written program would do all this, but essentially, what happens
  2314. > if an argument looks like a flag? Or have you never grep'ed for a string
  2315. > beginning with -?)
  2316.  
  2317. If -n is an option taking a value, then the next argument is its value,
  2318. even if it happens to have a - on the front.  The apparent ambiguity is
  2319. resolved by knowing which options take values and which don't.
  2320.  
  2321.                 Henry Spencer @ U of Toronto Zoology
  2322.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  2323.  
  2324. ----------------------------------------------------------------------
  2325.  
  2326. The moderated newsgroup mod.std.unix is for discussions of UNIX standards,
  2327. in particular of the draft standard in progress by the IEEE P1003
  2328. "UNIX Standards" Committee.
  2329.  
  2330. Submissions to the newsgroup to:    ut-sally!std-unix
  2331. Comments about the newsgroup to:    ut-sally!std-unix-request
  2332. Permission to post to the newsgroup is assumed for mail to the former address,
  2333. but not for mail to the latter address, nor for mail to my personal addresses.
  2334. -- 
  2335.  
  2336. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  2337. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  2338.  
  2339. Volume-Number: Volume 1, Number 24
  2340.  
  2341. From jsq  Tue Jul 16 14:44:04 1985
  2342. Path: ut-sally!jsq
  2343. From: jsq@ut-sally.UUCP (John Quarterman)
  2344. Newsgroups: mod.std.unix
  2345. Subject: Re: curses, terminfo, and termcap
  2346. Message-Id: <2366@ut-sally.UUCP>
  2347. Date: 16 Jul 85 19:43:50 GMT
  2348. References: <2257@ut-sally.UUCP> <2294@ut-sally.UUCP> <247@mcc-db.UUCP>
  2349. Reply-To: std-unix@ut-sally
  2350. Organization: U. Texas CS Dept., Austin, Texas
  2351. Lines: 23
  2352. Approved: jsq@ut-sally.UUCP
  2353. Summary: it's too big to post to this newsgroup or to mail
  2354. Draft-9: curses
  2355.  
  2356. From: John Quarterman (moderator) <jsq@ut-sally.UUCP>
  2357.  
  2358. Several people have asked by mail if I could repost the public domain terminfo
  2359. and curses or mail it to them.  Unfortunately, I cannot:  it's much too big
  2360. to post to a discussion newsgroup like this, or to mail (at least from
  2361. ut-sally:  our phone bills are rather amazing already).  The best thing
  2362. to do is probably to write to the moderator of mod.sources <genrad!john>
  2363. and see what arrangements have been made about getting back issues of
  2364. mod.sources.
  2365.  
  2366.  
  2367. The moderated newsgroup mod.std.unix is for discussions of UNIX standards,
  2368. in particular of the draft standard in progress by the IEEE P1003
  2369. "UNIX Standards" Committee.
  2370.  
  2371. Submissions to the newsgroup to:    ut-sally!std-unix
  2372. Comments about the newsgroup to:    ut-sally!std-unix-request
  2373. Permission to post to the newsgroup is assumed for mail to the former address,
  2374. but not for mail to the latter address, nor for mail to my personal addresses.
  2375. -- 
  2376.  
  2377. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  2378. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  2379.  
  2380. Volume-Number: Volume 1, Number 25
  2381.  
  2382. From jsq  Tue Jul 16 15:00:58 1985
  2383. Path: ut-sally!jsq
  2384. From: jsq@ut-sally.UUCP (John Quarterman)
  2385. Newsgroups: mod.std.unix
  2386. Subject: Scope and Purpose of IEEE P1003 "UNIX Standards" Committee
  2387. Message-Id: <2367@ut-sally.UUCP>
  2388. Date: 16 Jul 85 20:00:38 GMT
  2389. Reply-To: std-unix@ut-sally
  2390. Organization: U. Texas CS Dept., Austin, Texas
  2391. Lines: 84
  2392. Approved: jsq@ut-sally.UUCP
  2393. Draft-9: 1.0
  2394.  
  2395. From: John Quarterman (moderator) <jsq@ut-sally.UUCP>
  2396. Topic: IEEE P1003 "UNIX Standards" committee statement of scope and purpose
  2397.  
  2398. I've received the following from the chair of the committee for posting.
  2399.  
  2400.  
  2401. A.003.2
  2402. 15JAN85
  2403.            Scope and Purpose of the IEEE P1003 Working Group
  2404.  
  2405. "To define a standard operating system interface and environment based
  2406. on the  UNIX Operating System documentation to support application
  2407. portability at the source level. (UNIX is a trademark of Bell Labs)"
  2408.  
  2409. This effort entails three major components:
  2410.  
  2411. 1.  Definitions - Terminology and objects referred to in the document.
  2412.     In the case of objects, the structure, operations that modify these,
  2413.     and the effects of these operations need to be documented as well.
  2414.     (Sample Term:  Pipe, Sample Object:  File Descriptor)
  2415.  
  2416. 2.  Systems Interface and Subroutines (C-Language Binding)
  2417.     This area includes:
  2418.  
  2419.     A.  The range of interface & subroutines in the /usr/group document
  2420.     B.  IOCTL/TermIO
  2421.     C.  IFDEF Specifications
  2422.     D.  Real Time (Contiguous files, synchronization, shared data, priority
  2423.         scheduling, etc.)
  2424.     E.  Device interface, including Termcaps/TermIO
  2425.     F.  Job Control, Windowing
  2426.     G.  Network Interface (but not Protocol)
  2427.     H.  Distributed Systems
  2428.     I.  Device Drivers
  2429.     J.  Error Handling & Recovery
  2430.  
  2431. 3.  User interface issues, including:
  2432.  
  2433.     A.  Shell, Command Set, Syntax
  2434.     B.  Portability - Media/Formats
  2435.     C.  Error Handling & Recovery
  2436.  
  2437. In all of these areas, consideration will be given to defining the impact on
  2438. security, international usage (language and character sets, etc.), and 
  2439. application needs such as transaction processing.
  2440.  
  2441. The following areas may require review and commentary, perhaps even revisions
  2442. and updates, but are outside of the scope of the current effort:  Network
  2443. Protocols, Graphics, DBMS, Record I/O.
  2444.  
  2445. Two areas are explicitly outside of the scope of the group:  Binary compati-
  2446. bility/exchange of software in executable form, and the end-user interface
  2447. (where ease-of-use is a critical issue).
  2448.  
  2449. Target "consumers" of the documents are:  Systems implementations (including
  2450. AT&T Licensees, those developing compatible systems, and those implementing 
  2451. "hosted" systems), and application implementors - for areas 1 and 2.  With
  2452. Area 3, multivendor systems integrators and shell users are also identified 
  2453. as document consumers.
  2454.  
  2455. All of these efforts will not occur at once.  The initial document for 
  2456. balloting will be based on Section 1 and 2-A and B above.  As this goes 
  2457. through the balloting process, additional areas in 2 and 3 will be readied 
  2458. for balloting.  At this point, it is not clear if this will represent separate
  2459. revisions of a common document, separate "chapters" or "modules" of a common 
  2460. document, or separate standards documents.
  2461.  
  2462. ----------------------------------------------------------------------
  2463.  
  2464. The moderated newsgroup mod.std.unix is for discussions of UNIX standards,
  2465. in particular of the draft standard in progress by the IEEE P1003
  2466. "UNIX Standards" Committee.
  2467.  
  2468. Submissions to the newsgroup to:    ut-sally!std-unix
  2469. Comments about the newsgroup to:    ut-sally!std-unix-request
  2470. Permission to post to the newsgroup is assumed for mail to the former address,
  2471. but not for mail to the latter address, nor for mail to my personal addresses.
  2472.  
  2473. The newsgroup is gatewayed to an ARPA Internet mailing list, accessible as
  2474. std-unix@ut-sally.ARPA or std-unix-request@ut-sally.ARPA.
  2475. -- 
  2476.  
  2477. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  2478. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  2479.  
  2480. Volume-Number: Volume 1, Number 26
  2481.  
  2482. From jsq  Wed Jul 17 09:02:27 1985
  2483. Path: ut-sally!jsq
  2484. From: jsq@ut-sally.UUCP (John Quarterman)
  2485. Newsgroups: mod.std.unix
  2486. Subject: Re: curses, terminfo, and termcap
  2487. Message-Id: <2376@ut-sally.UUCP>
  2488. Date: 17 Jul 85 14:02:14 GMT
  2489. References: <2257@ut-sally.UUCP> <2294@ut-sally.UUCP> <247@mcc-db.UUCP> <2366@ut-sally.UUCP>
  2490. Reply-To: jsq@ut-sally.UUCP (John Quarterman)
  2491. Organization: U. Texas CS Dept., Austin, Texas
  2492. Lines: 73
  2493. Approved: jsq@ut-sally.UUCP
  2494. Summary: how to get Pavel Curtis' implementation
  2495. Draft-9: curses
  2496.  
  2497. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  2498. Topic: curses, terminfo, and termcap
  2499.  
  2500. ----------------------------------------------------------------------
  2501.  
  2502. From: harvard!panda!genrad!john (John P. Nelson)
  2503. Date: Wed, 17 Jul 85 09:23:12 edt
  2504. To: panda!talcott!harvard!seismo!ut-sally!jsq
  2505. Subject: Re: curses, terminfo, and termcap
  2506. In-Reply-To: <2366@ut-sally.UUCP>
  2507. References: <2257@ut-sally.UUCP> <2294@ut-sally.UUCP> <247@mcc-db.UUCP>
  2508. Organization: GenRad, Inc., Bolton, Mass.
  2509.  
  2510.  
  2511. Please post this to mod.std.unix, since you have recommended that your
  2512. readership contact me directly.
  2513.  
  2514.   John P. Nelson (decvax!genrad!john) [moderator, mod.sources]
  2515.  
  2516. First, if you have access to any of the "standard" UNIX versions of curses,
  2517. you have got a better version than this one.  About the only thing that
  2518. recommends Pavel Curtis' version of curses is that it is public domain.
  2519. (Of course, that is pretty significant!) The terminfo implementation seems
  2520. to fairly solid, however.
  2521.  
  2522.  
  2523. For large distributions (such as the Pavel Curtis' terminfo/curses - 11 shar
  2524. format modules plus one more with updates) I try to discourage direct mailing
  2525. especially when the target site is several uucp hops away.  That generally
  2526. leaves two alternatives:  1. Send a tape in a self-addressed, stamped mailer.
  2527. I will put the distribution onto tape in tar, 1600 bpi format.  If you do
  2528. this, then make sure you include a note describing what you want put onto the
  2529. tape (Public Domain Terminfo/Curses package)  2.  I can send you the info for
  2530. our site's "sources" uucp login.  This uucp login is limited to transferring
  2531. to and from a single "sources" directory.  I am not making this login public
  2532. knowledge, because we cannot support any large level of traffic.
  2533.  
  2534. I am willing to entertain other suggestions.
  2535.  
  2536. John P. Nelson (decvax!genrad!john) [moderator, mod.sources]
  2537. GenRad   M.S. 96
  2538. 37 Great Road
  2539. Bolton, MA 01740
  2540.  
  2541. ----------------------------------------------------------------------
  2542.  
  2543. Date: Wed, 17 Jul 85 08:31:57 cdt
  2544. From: jsq@ut-sally.ARPA (John Quarterman)
  2545. Subject: Re:  PD terminfo, curses, etc.
  2546.  
  2547. If you are on the ARPA Internet, you can get it by anonymous FTP
  2548. (login anonymous, password guest) from ut-sally.ARPA from the directory
  2549. ~ftp/pub/curses, where the files named 1 through 11 correspond to the
  2550. pieces posted on mod.sources.  There doesn't seem to be a standard ARPA
  2551. Internet repository for mod.sources.
  2552.  
  2553. ----------------------------------------------------------------------
  2554.  
  2555. The moderated newsgroup mod.std.unix is for discussions of UNIX standards,
  2556. in particular of the draft standard in progress by the IEEE P1003
  2557. "UNIX Standards" Committee.
  2558.  
  2559. Submissions to the newsgroup to:    ut-sally!std-unix
  2560. Comments about the newsgroup to:    ut-sally!std-unix-request
  2561. Permission to post to the newsgroup is assumed for mail to the former address,
  2562. but not for mail to the latter address, nor for mail to my personal addresses.
  2563.  
  2564. The newsgroup is gatewayed to an ARPA Internet mailing list, accessible as
  2565. std-unix@ut-sally.ARPA or std-unix-request@ut-sally.ARPA.
  2566. -- 
  2567.  
  2568. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  2569. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  2570.  
  2571. Volume-Number: Volume 1, Number 27
  2572.  
  2573. From jsq  Thu Jul 18 10:21:26 1985
  2574. Path: ut-sally!jsq
  2575. From: jsq@ut-sally.UUCP (John Quarterman)
  2576. Newsgroups: mod.std.unix
  2577. Subject: standardized error messages
  2578. Message-Id: <2391@ut-sally.UUCP>
  2579. Date: 18 Jul 85 15:10:09 GMT
  2580. Reply-To: std-unix@ut-sally
  2581. Organization: U. Texas CS Dept., Austin, Texas
  2582. Lines: 36
  2583. Approved: jsq@ut-sally.UUCP
  2584. Draft-9: 2.5
  2585.  
  2586. From: Mike Trachtman  <wizard%wisdom.bitnet@WISCVM.ARPA>
  2587. Date: Thu, 18 Jul 85 13:03:51 -0200
  2588. To: std-unix@ut-sally.arpa
  2589. Subject: standardized error messages
  2590.  
  2591. Is any thought being given to having the compilers, grep, etc.
  2592. give error messages in a standard form, so
  2593. that programs will be able to parse them.
  2594.  
  2595. This is good for many things, in particular emacs make error parsing,
  2596. but other uses are also possible.
  2597. Mike
  2598.  
  2599.                                 Mike Trachtman
  2600. My address:
  2601.  
  2602.         wizard@wisdom                           (BITNET)
  2603.         wizard%wisdom.bitnet@wiscvm.ARPA        (ARPA/CSNET)
  2604.         wizard%wisdom.bitnet@berkley            (ARPA/CSNET)
  2605. and if all else fails (ONLY for VERY short items)
  2606.         ...!decvax!humus!wisdom!wizard          (UUCP)
  2607.  
  2608. ----------------------------------------------------------------------
  2609.  
  2610. This moderated newsgroup, mod.std.unix, is for discussions of UNIX standards,
  2611. in particular of the draft standard in progress by the IEEE P1003 Committee.
  2612. The newsgroup is also gatewayed to an ARPA Internet mailing list.
  2613.  
  2614. Submissions to:    ut-sally!std-unix      or std-unix@ut-sally.ARPA
  2615. Comments to:    ut-sally!std-unix-request or std-unix-request@ut-sally.ARPA
  2616. Permission to post to the newsgroup is assumed for mail to std-unix,
  2617. but not for mail to std-unix-request, nor for mail to my personal addresses.
  2618. -- 
  2619.  
  2620. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  2621. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  2622.  
  2623. Volume-Number: Volume 1, Number 28
  2624.  
  2625. From jsq  Thu Jul 18 10:54:08 1985
  2626. Path: ut-sally!jsq
  2627. From: jsq@ut-sally.UUCP (John Quarterman)
  2628. Newsgroups: mod.std.unix
  2629. Subject: Re: a bit more on getopt
  2630. Message-Id: <2392@ut-sally.UUCP>
  2631. Date: 18 Jul 85 15:53:58 GMT
  2632. References: <251@mcc-db.UUCP> <2365@ut-sally.UUCP>
  2633. Reply-To: std-unix@ut-sally
  2634. Organization: U. Texas CS Dept., Austin, Texas
  2635. Lines: 179
  2636. Approved: jsq@ut-sally.UUCP
  2637. Draft-9: 1003.2.getopt
  2638.  
  2639. From: John Quarterman <std-unix-request@ut-sally.UUCP> (moderator)
  2640. Topic: command line arguments (getopt)
  2641.  
  2642. > There's getting to be a bit of repetition and a certain amount of
  2643. > flamage on this subject.  Several things seem clear to me, at least:
  2644. > 1) Keith Bostic's getopt is the de facto standard public domain getopt
  2645.  
  2646. Well, it seems I may have been hasty to state that.  More follows.
  2647.  
  2648. ----------------------------------------------------------------------
  2649.  
  2650. Date: Tue, 16 Jul 85 19:10:43 edt
  2651. From: ihnp4!cmcl2!edler (Jan Edler)
  2652. To: ihnp4!ut-sally!std-unix
  2653. Subject: another getopt
  2654.  
  2655. Another important public-domain implementation of getopt(3)
  2656. is the one from AT&T available from the UNIX system toolchest.
  2657.  
  2658.     Jan Edler
  2659.     New York University
  2660.     ihnp4!cmcl2!edler
  2661.     edler@nyu.arpa
  2662.  
  2663. [ The toolchest number is 201-522-6900, where you can log in as guest.
  2664. Getopt is listed as for $0.00, though there is evidently a $100.00
  2665. registration fee, a transfer fee ($10?) and tax.
  2666.  
  2667. If the source for this was actually published in the Dallas /usr/group
  2668. meeting proceedings, could someone who has them please type it in and
  2669. submit it to this newsgroup?  I could assume that the getopt in my
  2670. System V sources is the same as that published at Dallas and post it,
  2671. but it might not be.  -mod ]
  2672.  
  2673. ----------------------------------------------------------------------
  2674.  
  2675. From: seismo!cbosgd!pegasus!hansen (Tony Hansen)
  2676. Date: Thu, 18 Jul 85 01:29:42 EDT
  2677. To: ut-sally!std-unix, cbosgd!seismo!keith
  2678. Subject: Re: getopt(3) (again...)
  2679. In-Reply-To: <250@mcc-db.UUCP>
  2680. Organization: AT&T-IS Labs, Lincroft, NJ
  2681.  
  2682. In article <250@mcc-db.UUCP> you write:
  2683. >Date: Thu, 11 Jul 85 14:07:41 EDT
  2684. >From: Keith Bostic <keith@seismo.CSS.GOV>
  2685. >Subject: getopt(3) (again...)
  2686. >
  2687. >Just when I thought it was safe to read my mail...
  2688. >
  2689. >> From: harvard!talcott!wjh12!mirror!rs@ut-sally.ARPA (Rich Salz)
  2690. >>
  2691. >> i made a couple of changes.  esthetics, absolutely no stdio if
  2692. >> desired, and the opterr variable.  here's my revision:
  2693. >
  2694. >I'm getting pretty tired of this whole issue -- in fact, I kept starting
  2695. >to reply to your mail and then deciding not to, figuring that if I didn't
  2696. >maybe the whole thing would die off.  *sigh*  Well, my friend, here's
  2697. >a reply.  The content is simple.  You are wrong.  Pure-d, absolutely,
  2698. >wrong.
  2699.  
  2700. Actually, the recently posted rewrite by Rich Salz is closer to AT&T's code
  2701. than is yours and his is more accurate.
  2702.  
  2703. >Point by point:
  2704. >
  2705.     ... (no comment on aesthetics)
  2706. >
  2707. >absolutely no stdio if desired:
  2708. >    Well, for an error condition that's going to happen once before the
  2709. >program exits, it's gonna be faster.  You saved about 2 routine calls, near
  2710. >as I can figure.  You didn't save any library space, which is why I changed
  2711. >the original fprintf() calls to fputs() calls.
  2712.  
  2713. Actually this is important in some applications which do not already use
  2714. stdio and do not wish to load in the 10k or so overhead that using stdio
  2715. incurs. AT&T's code does not use stdio in getopt(3).
  2716.  
  2717. >the opterr variable:
  2718. >    The other two items, I could live with.  Here, on the other hand,
  2719. >you have single-handedly created a real pain in the ass in terms of
  2720. >portability.
  2721. >
  2722. >Scenario #1:
  2723. >    Bell Labs doesn't ever decide to use opterr.  Fine and dandy,
  2724. >    except that people who use your new flag will find that their
  2725. >    code will not run as expected on USG UNIX.
  2726.  
  2727. Sigh. Here's the real crux of the matter: USG UNIX already has and uses
  2728. opterr exactly as used by Rich's code. It is poorly documented,
  2729. unfortunately.
  2730.  
  2731. >I would have been much more amenable to changes two months ago; if you
  2732. >can get Mike Karels to use your version rather than mine, I will again
  2733. >be much more amenable to changes.  Well, with the exception of your use
  2734. >of opterr.
  2735.  
  2736. I thought UCB had a System V license. Couldn't they have checked your
  2737. public-domain version against the code that was in the System V source
  2738. easily enough for incompatibilities?
  2739.  
  2740. In fact, why go with yours or Rich's version at all and not use the
  2741. public-domain version that AT&T published at January's Uni-Forum in Dallas?
  2742. That would have gotten rid of all thought of incompatiblity!
  2743. [ They may not have been aware of it:  few other people seem to be.
  2744. Perhaps you could type it in and submit it to the newsgroup? -mod ]
  2745.  
  2746. >  The world does not need another getopt.
  2747.  
  2748. You're right. Why'd you bother adding one? :-)
  2749.  
  2750. >    ..., or, of course, we could just diverge the two systems
  2751. >    again.  Fun, fun!
  2752.  
  2753. I hope 4.3BSD picks up AT&T's public-domain version of getopt(3) for use
  2754. rather than creating yet-another branching of ways by using yours, Keith, or
  2755. Rich's.  [ You could submit the AT&T source to Berkeley as a bug fix.  -mod ]
  2756.  
  2757.                     Tony Hansen
  2758.                     ihnp4!pegasus!hansen
  2759.  
  2760. ----------------------------------------------------------------------
  2761.  
  2762. From: Dave Berry <seismo!cstvax.ed.ac.uk!mcvax!db>
  2763. Date: Tue, 16 Jul 85 15:43:56 bst
  2764. To: ut-sally!std-unix
  2765. Subject: Command lines
  2766.  
  2767. It's probably way too late for this to be suggested, but the longer it's
  2768. left, the worse it will be.
  2769. How about completely revamping the unix command line syntax to be
  2770.     command {{-option ...} {file ...} ...}
  2771. with command names & option names being full words (e.g. remove, not rm)
  2772. and using command (and argument) completion a la VMS?  I used UNIX for three
  2773. years before using VMS, and I far prefer this approach to command line syntax
  2774. (though VMS filenames & DCL are appalling!).
  2775.     A couple of MMI articles I've read (in CACM I think) report evidence
  2776. that users far prefer command completion to cryptic abbreviations in the
  2777. UNIX tradition.
  2778.     The rest of UNIX is being dragged kicking & screaming into the
  2779. "real world" - I'd like to see this change happen too.
  2780.  
  2781. [ Command and file name completion has been added to the C shell in
  2782. several steps and posted to net.sources over the last couple of years.
  2783. 4.3BSD will include both (made quite a bit more efficient) as an option
  2784. in the distributed C shell (according to what the Berkeley CSRG people
  2785. said at the 4BSD BOF at the Portland USENIX).  I don't know if such
  2786. has been done in any version of the Bourne or Korn shells.  -mod ]
  2787.  
  2788. ----------------------------------------------------------------------
  2789.  
  2790. From: jsq@ut-sally.ARPA (John Quarterman)
  2791. Date: Thu Jul 18 10:51:48 CDT 1985
  2792. To: ut-sally!std-unix
  2793. Subject: Re: Command lines
  2794.  
  2795. It seems to me that general command argument completion would have to
  2796. be implemented in each command, and would require each command to be
  2797. able to interact with terminals.  Doesn't seem worth it to me, but then
  2798. I've always thought argument completion to be one of TENEX/TOPS-20/VMS's
  2799. most annoying features.  Argument completion would also seem to rule
  2800. out multiple options in the same word, which is a bit of a compatibility
  2801. problem.
  2802.  
  2803. ----------------------------------------------------------------------
  2804.  
  2805. This moderated newsgroup, mod.std.unix, is for discussions of UNIX standards,
  2806. in particular of the draft standard in progress by the IEEE P1003 Committee.
  2807. The newsgroup is also gatewayed to an ARPA Internet mailing list.
  2808.  
  2809. Submissions to:    ut-sally!std-unix      or std-unix@ut-sally.ARPA
  2810. Comments to:    ut-sally!std-unix-request or std-unix-request@ut-sally.ARPA
  2811. Permission to post to the newsgroup is assumed for mail to std-unix,
  2812. but not for mail to std-unix-request, nor for mail to my personal addresses.
  2813. -- 
  2814.  
  2815. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  2816. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  2817.  
  2818. Volume-Number: Volume 1, Number 29
  2819.  
  2820. From jsq  Thu Jul 18 17:48:55 1985
  2821. Path: ut-sally!jsq
  2822. From: jsq@ut-sally.UUCP (John Quarterman)
  2823. Newsgroups: mod.std.unix
  2824. Subject: Re: a bit more on getopt
  2825. Message-Id: <2399@ut-sally.UUCP>
  2826. Date: 18 Jul 85 22:48:44 GMT
  2827. References: <251@mcc-db.UUCP> <2365@ut-sally.UUCP> <2392@ut-sally.UUCP>
  2828. Reply-To: std-unix@ut-sally
  2829. Organization: U. Texas CS Dept., Austin, Texas
  2830. Lines: 82
  2831. Approved: jsq@ut-sally.UUCP
  2832. Draft-9: 1003.2.getopt
  2833.  
  2834. From: John Quarterman (moderator) <jsq@ut-sally.UUCP>
  2835. Topic: still more on command line arguments (getopt)
  2836.  
  2837. ----------------------------------------------------------------------
  2838.  
  2839. From: seismo!nsc!idi!bene!luke!itkin (Steven List)
  2840. Date: Thu, 18 Jul 85 09:20:51 pdt
  2841. To: ut-sally.ARPA!std-unix
  2842. Subject: extraneous arguments
  2843. Organization: Benetics Corp, Mt. View, CA
  2844.  
  2845. >From: ihnp4!tektronix!uucp@ut-sally.ARPA
  2846. >Date: Saturday, 13 Jul 85 18:43:47 PDT
  2847. >Subject: What to do about extraneous arguments?
  2848. >
  2849. >Another aspect of command arguments is: after all the necessary arguments
  2850. >have been processed, what if some are left?
  2851. >
  2852.  
  2853. I'm in agreement with tektronix!rdoty.  I believe no program should produce
  2854. unexpected results without some explanation.  In the case of programs
  2855. like cmp and diff, a diagnostic AND a nonzero exit status would seem to
  2856. be appropriate.  The diagnostic message would tend to satisfy checks on
  2857. the size of the output being nonzero, and the status would satisfy
  2858. status checks.
  2859.  
  2860. ----------------------------------------------------------------------
  2861.  
  2862. Date: Wed, 17 Jul 85 12:00:54 cdt
  2863. From: neuro1!baylor!peter@rice.uucp (Peter da Silva)
  2864. Subject: Re: Re: command line arguments
  2865. References: <245@mcc-db.UUCP>
  2866.  
  2867. > Date: Mon, 8 Jul 85 00:52:46 pdt
  2868. > From: nsc!turtlevax!ken@ihnp4.UUCP (Ken Turkowski)
  2869. > Subject: Re: command line arguments
  2870. > Someone suggested that parsing arguments in shell scripts was difficult.
  2871. > I include the following shell scripts, one for the Bourne shell and one
  2872. > for the C-shell, which parse arguments of the form:
  2873. >     -v -O -o outfile file1 file2 file3
  2874. > as well as
  2875. >     -vOooutfile file1 file2 file3
  2876.  
  2877. Sure, you can make shell scripts do almost anything. When I get a source with
  2878. that sort of stuff in it I generally rip it out & put up with weirdness. Why?
  2879. Well, our system is badly overloaded. Commands like that take 30 seconds to
  2880. a minute to start up!
  2881.  
  2882. ----------------------------------------------------------------------
  2883.  
  2884. Date: Wed, 17 Jul 85 12:04:53 cdt
  2885. From: neuro1!baylor!peter@rice.uucp (Peter da Silva)
  2886. Subject: Re: Re: command line arguments
  2887. References: <246@mcc-db.UUCP>
  2888.  
  2889. > > I doubt the necessity and even the wisdom of seperating an argument from
  2890. > > the option by whitespace.
  2891. > As I recall it, the AT&T standard does it this way on the grounds of
  2892. > readability, not necessity.  The "-t/dev/tty" example is an easy one
  2893. > to pick out, but what about "-dfaglop"?  Which of those letters are
  2894. > options, and which are an option argument?
  2895.  
  2896. OK, instead of forcing whitespace, how about requiring that there only be one
  2897. flag if you are going to do this sort of stuff? I have had shell scripts
  2898. totally broken by this requirement, and workarounds take up so much overhead
  2899. (yes, some people have systems smaller than vaxen) that it's not worth the
  2900. hassle.
  2901.  
  2902. ----------------------------------------------------------------------
  2903.  
  2904. This moderated newsgroup, mod.std.unix, and the corresponding ARPA Internet
  2905. mailing list, is for discussions of UNIX standards; specifically
  2906. the draft standard in progress by the IEEE P1003 Committee.
  2907. Submissions to:    ut-sally!std-unix      or std-unix@ut-sally.ARPA
  2908. Comments to:    ut-sally!std-unix-request or std-unix-request@ut-sally.ARPA
  2909. -- 
  2910.  
  2911. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  2912. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  2913.  
  2914. Volume-Number: Volume 1, Number 30
  2915.  
  2916. From jsq  Thu Jul 18 20:32:27 1985
  2917. Path: ut-sally!jsq
  2918. From: jsq@ut-sally.UUCP (John Quarterman)
  2919. Newsgroups: mod.std.unix
  2920. Subject: Re: a bit more on getopt
  2921. Message-Id: <2401@ut-sally.UUCP>
  2922. Date: 19 Jul 85 01:32:22 GMT
  2923. References: <251@mcc-db.UUCP> <2365@ut-sally.UUCP> <2392@ut-sally.UUCP>
  2924. Reply-To: std-unix@ut-sally.UUCP
  2925. Organization: U. Texas CS Dept., Austin, Texas
  2926. Lines: 34
  2927. Approved: jsq@ut-sally.UUCP
  2928. Draft-9: 1003.2.getopt
  2929.  
  2930. Date: Thu, 18 Jul 85 20:29:59 EDT
  2931. From: Keith Bostic <seismo!keith>
  2932. To: /dev/null
  2933. Subject: Re: getopt(3) (again...)
  2934. Cc: pegasus!hansen, ut-sally!std-unix
  2935.  
  2936. > Actually, the recently posted rewrite by Rich Salz is closer to AT&T's code
  2937. > than is yours and his is more accurate.
  2938.  
  2939. You're right, I apologize.  I totally missed the USG use of opterr and have
  2940. updated my code appropriately.  I am currently trying to get 4.3 to use
  2941. the correct code.
  2942.  
  2943. > Actually this is important in some applications which do not already use
  2944. > stdio and do not wish to load in the 10k or so overhead that using stdio
  2945. > incurs. AT&T's code does not use stdio in getopt(3).
  2946.  
  2947. Not true.  The size difference between:
  2948.  
  2949.     main() { puts("foo"); }
  2950. and
  2951.     main() { write(0,"foo",3); }
  2952.  
  2953. is exactly zero.
  2954.  
  2955. > In fact, why go with yours or Rich's version at all and not use the
  2956. > public-domain version that AT&T published at January's Uni-Forum in Dallas?
  2957. > That would have gotten rid of all thought of incompatiblity!
  2958.  
  2959. Amen, I didn't know about it in January or I would have said something when
  2960. Berkeley asked to use mine.
  2961.  
  2962. --keith
  2963.  
  2964.  
  2965. Volume-Number: Volume 1, Number 31
  2966.  
  2967. From jsq  Fri Jul 19 17:53:20 1985
  2968. Path: ut-sally!jsq
  2969. From: jsq@ut-sally.UUCP (John Quarterman)
  2970. Newsgroups: mod.std.unix
  2971. Subject: Re: a bit more on getopt
  2972. Message-Id: <2409@ut-sally.UUCP>
  2973. Date: 19 Jul 85 22:53:13 GMT
  2974. References: <251@mcc-db.UUCP> <2365@ut-sally.UUCP> <2392@ut-sally.UUCP> <2401@ut-sally.UUCP>
  2975. Reply-To: std-unix@ut-sally.UUCP
  2976. Organization: U. Texas CS Dept., Austin, Texas
  2977. Lines: 35
  2978. Approved: jsq@ut-sally.UUCP
  2979. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  2980. Submissions-To:     ut-sally!std-unix    or std-unix@ut-sally.ARPA
  2981. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  2982. Uucp-Routes: {ihnp4ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  2983. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  2984. Draft-9: 1003.2.getopt
  2985.  
  2986. From: seismo!BBN-LABS-B.ARPA!dan (Dan Franklin)
  2987. To: ut-sally!BBN-LABS-B.ARPA!std-unix
  2988. Subject: Re: a bit more on getopt
  2989. Date: 19 Jul 85 11:32:03 EDT (Fri)
  2990.  
  2991. >  > Actually this is important in some applications which do not already use
  2992. >  > stdio and do not wish to load in the 10k or so overhead that using stdio
  2993. >  > incurs. AT&T's code does not use stdio in getopt(3).
  2994. >  Not true.  The size difference between:
  2995. >      main() { puts("foo"); }
  2996. >  and
  2997. >      main() { write(0,"foo",3); }
  2998. >  is exactly zero.
  2999.  
  3000. Your second one-liner is still using stdio.  The difference between
  3001.        main() { puts("foo"); }
  3002. and
  3003.        main() { write(1, "foo", 3); }   exit(n) { _exit(n); }
  3004. on the other hand, is substantial, at least on my 4.2 VAX system (and, in my
  3005. experience, on other UNIX systems as well):
  3006.  
  3007. text    data    bss    dec    hex
  3008. 2048    1024    15988    19060    4a74    stdio
  3009. 1024    1024    0     2048     800    nostdio
  3010.  
  3011. 1024       0    25988   17012           difference
  3012.  
  3013. The point about not using stdio in a library routine if it's not necessary
  3014. still stands.
  3015.  
  3016.     Dan Franklin
  3017.  
  3018.  
  3019. Volume-Number: Volume 1, Number 32
  3020.  
  3021. From jsq  Sun Jul 21 12:59:22 1985
  3022. Path: ut-sally!jsq
  3023. From: jsq@ut-sally.UUCP (John Quarterman)
  3024. Newsgroups: mod.std.unix
  3025. Subject: Re: a bit more on getopt
  3026. Message-Id: <2422@ut-sally.UUCP>
  3027. Date: 21 Jul 85 17:59:14 GMT
  3028. References: <251@mcc-db.UUCP> <2365@ut-sally.UUCP> <2392@ut-sally.UUCP> <2401@ut-sally.UUCP> <2409@ut-sally.UUCP>
  3029. Reply-To: std-unix@ut-sally.UUCP
  3030. Organization: U. Texas CS Dept., Austin, Texas
  3031. Lines: 214
  3032. Approved: jsq@ut-sally.UUCP
  3033. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3034. Submissions-To:     ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3035. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3036. Uucp-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3037. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3038. Draft-9: 1003.2.getopt
  3039.  
  3040. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  3041. Topic: command line arguments (getopt)
  3042.     Is the AT&T getopt public domain, or just published?
  3043.     AT&T getopt(3) man page is inaccurate.
  3044.     Inclusion of stdio and size of programs.
  3045.     Options, white space, and shell scripts.
  3046.     Full word command names and arguments, and completion.
  3047.  
  3048. ----------------------------------------------------------------------
  3049.  
  3050. From: ihnp4!utzoo!henry (Henry Spencer)
  3051. Date: 19 Jul 85 20:14:44 CDT (Fri)
  3052. To: ihnp4!seismo!ut-sally!std-unix
  3053. Subject: Is AT&T getopt public-domain?  Not clear!
  3054.  
  3055. The document I have from the /usr/group standards meeting at Dallas
  3056. does *not* say that the AT&T getopt is being made public domain.  What
  3057. it says is:
  3058.  
  3059.     The [getopt] source code is being published by AT&T Bell
  3060.     Laboratories to encourage adherence to the command syntax
  3061.     standard and to satisfy requests from [everyone in sight].
  3062.  
  3063. Note that publishing something does *not* put it into the public domain
  3064. unless this is stated explicitly.  That may have been AT&T's intent, but
  3065. they didn't say it that way.  The document in question includes the AT&T
  3066. source, but I am reluctant to submit it to mod.std.unix until its status
  3067. is clarified.
  3068.  
  3069.                 Henry Spencer @ U of Toronto Zoology
  3070.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  3071.  
  3072. ------------------------------
  3073.  
  3074. Date: 20 Jul 85 11:03:28 EDT (Sat)
  3075. From: topaz!packard!nomad!ggr (Guy Riddle)
  3076. Subject: getopt: the Code vs. the Manual Page
  3077. To: ut-sally!std-unix
  3078. Cc: seismo!keith
  3079.  
  3080. I hope you haven't been modelling the 4.3 version of getopt(3) too
  3081. closely after the SVR2 manual page, for it lies about the details.
  3082.  
  3083. It states
  3084.  
  3085.     "Because optind is external, it is normally initialized to
  3086.     zero automatically before the first call to getopt."
  3087.  
  3088. Well, I'll grant that optind is external, but it is initialized to one.
  3089.  
  3090. Also, the claim that
  3091.  
  3092.     "This error message may be disabled by setting opterr
  3093.     to a non-zero value."
  3094.  
  3095. is also a lie.  Opterr is initialized to one, and to disable the error
  3096. message you must set it to zero.
  3097.  
  3098.         === Guy Riddle == AT&T Bell Laboratories, New Jersey ===
  3099.  
  3100. ----------
  3101. |Rebuttal
  3102. |Corner
  3103. |
  3104.     Keith's assertion that
  3105.  
  3106.     > Not true.  The size difference between:
  3107.     > 
  3108.     >     main() { puts("foo"); }
  3109.     > and
  3110.     >     main() { write(0,"foo",3); }
  3111.     > 
  3112.     > is exactly zero.
  3113.  
  3114.     might be valid for 4.2, but it's not for SVR2, where the size of the
  3115.     puts(3) version is
  3116.  
  3117.         2432 + 456 + 2232 = 5120
  3118.  
  3119.     while the write(2) version is only
  3120.  
  3121.         128 + 12 + 0 = 140
  3122.  
  3123. ------------------------------
  3124.  
  3125. From: ihnp4!decvax!borman (Dave Borman)
  3126. Date: Sat, 20 Jul 85 21:01:42 edt
  3127. To: decvax!ihnp4!ut-sally!std-unix
  3128. Subject: getopt(3) & stdio
  3129.  
  3130. >  >  > Actually this is important in some applications which do not already use
  3131. >  >  > stdio and do not wish to load in the 10k or so overhead that using stdio
  3132. >  >  > incurs. AT&T's code does not use stdio in getopt(3).
  3133. >  > 
  3134. >  >  Not true.  The size difference between:
  3135. >  > 
  3136. >  >      main() { puts("foo"); }
  3137. >  >  and
  3138. >  >      main() { write(0,"foo",3); }
  3139. >  > 
  3140. >  >  is exactly zero.
  3141. >  
  3142. >  Your second one-liner is still using stdio.  The difference between
  3143. >     main() { puts("foo"); }
  3144. >  and
  3145. >     main() { write(1, "foo", 3); }   exit(n) { _exit(n); }
  3146. >  on the other hand, is substantial, at least on my 4.2 VAX system (and, in my
  3147. >  experience, on other UNIX systems as well):
  3148.  
  3149. The first two examples are different, the puts() will pull in stdio and
  3150. the write() should not.  If you have to explicitly re-declare exit() to
  3151. avoid pulling in the stdio package, then your /lib/libc.a is mucked up.
  3152. exit() calls _cleanup, of which there are two copies in the /lib/libc.a.
  3153. The stdio package has a function _cleanup which flushes all the buffers.
  3154. There is also a dummy _cleanup routine (usually fakcu.s) which just
  3155. returns.  In /lib/libc.a, exit() must be archived after all the stdio
  3156. functions, and the dummy _cleanup must be archived after exit.  If you
  3157. have exit() before the stdio functions, then the reference to _cleanup
  3158. will pull in the whole stdio package.  If exit() is after the stdio
  3159. package and the dummy _cleanup after exit(), then if you don't reference
  3160. any stdio functions you will only pull in the dummy cleanup routine.
  3161.  
  3162.         -Dave Borman, Digital UNIX Engineering Group.
  3163.         decvax!borman
  3164.  
  3165. ------------------------------
  3166.  
  3167. Date: Sat, 20 Jul 85 16:31:33 PDT
  3168. From: seismo!sun!guy (Guy Harris)
  3169. To: ut-sally!jsq
  3170. Subject: Re: a bit more on getopt
  3171.  
  3172. > Not true.  The size difference between:
  3173. >
  3174. >    main() { puts("foo"); }
  3175. > and
  3176. >    main() { write(0,"foo",3); }
  3177. >
  3178. > is exactly zero.
  3179.  
  3180. Only true on certain UNIX implementations.  Under Sun UNIX 2.0
  3181. (4.2BSD-based), there is a slight difference.  Under System V there is a
  3182. significant difference.  The problem is that 4.2BSD *always* drags in the
  3183. Standard I/O Library while System V doesn't.  4.xBSD could be changed, with
  3184. about 30 minutes work, to work the way System V does here, so the assumption
  3185. should be made that the Standard I/O Library does consume a nonzero amount
  3186. of code and data space.  (About 13788 bytes in one test I did; this doesn't
  3187. count buffers which are "malloc"ed when the first read/write is done.)
  3188.  
  3189.     Guy Harris
  3190.  
  3191. ------------------------------
  3192.  
  3193. From: ihnp4!utzoo!henry (Henry Spencer)
  3194. Date: 20 Jul 85 20:45:50 CDT (Sat)
  3195. To: ihnp4!seismo!ut-sally!std-unix
  3196. Subject: Re: a bit more on getopt
  3197. References: <251@mcc-db.UUCP> <2365@ut-sally.UUCP> <2392@ut-sally.UUCP>, <2399@ut-sally.UUCP>
  3198.  
  3199. > > ...  The "-t/dev/tty" example is an easy one
  3200. > > to pick out, but what about "-dfaglop"?  Which of those letters are
  3201. > > options, and which are an option argument?
  3202. > OK, instead of forcing whitespace, how about requiring that there only be one
  3203. > flag if you are going to do this sort of stuff? I have had shell scripts
  3204. > totally broken by this requirement, and workarounds take up so much overhead
  3205. > (yes, some people have systems smaller than vaxen) that it's not worth the
  3206. > hassle.
  3207.  
  3208. We do a *lot* of shell programming, and our experience is that the
  3209. separating blank makes life easier, not harder.  Of course, we generally
  3210. use getopt(1) for the argument parsing, which makes life simpler.  utzoo
  3211. is a PDP11, by the way.
  3212.  
  3213.                 Henry Spencer @ U of Toronto Zoology
  3214.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  3215.  
  3216. ------------------------------
  3217.  
  3218. From: ihnp4!utzoo!henry (Henry Spencer)
  3219. Date: 19 Jul 85 20:15:23 CDT (Fri)
  3220. To: ihnp4!seismo!ut-sally!std-unix
  3221. Subject: Command lines
  3222.  
  3223. > It's probably way too late for this to be suggested, but the longer it's
  3224. > left, the worse it will be.
  3225. > How about completely revamping the unix command line syntax to be
  3226. >     command {{-option ...} {file ...} ...}
  3227. > with command names & option names being full words (e.g. remove, not rm)...
  3228.  
  3229. The AT&T command-line-syntax people have alluded to attempts to do this
  3230. in the past at AT&T.  They were failures.  It is not enough to decree a
  3231. standard; one must also convince people to accept it.  The getopt standard
  3232. has been widely accepted precisely *because* it tidies up and standardizes
  3233. the existing situation, rather than trying to impose radical change.
  3234.  
  3235. There are also problems with full-word options, and worse problems with
  3236. full-word options that can be arbitrarily abbreviated, but I won't get
  3237. into that since it seems a digression.
  3238.  
  3239. I've thought about this at considerable length, and concluded that radical
  3240. change will require more incentive than a simplistic revision of command
  3241. syntax would provide.  VMS-style "completion" isn't enough.  What one wants
  3242. is much more sophisticated help in command construction, including things
  3243. like interactive "help" information for options, knowledge of the semantics
  3244. of arguments so that error repair can be applied, etc.  Imbedding this into
  3245. every program seems dubious; it would seem better to have a sophisticated
  3246. shell which uses a database describing the commands.  Note that such an
  3247. interface could completely hide the details of the *actual* command syntax.
  3248. Someday...
  3249.                 Henry Spencer @ U of Toronto Zoology
  3250.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  3251.  
  3252. ------------------------------
  3253.  
  3254. Volume-Number: Volume 1, Number 33
  3255.  
  3256. From jsq  Sun Jul 21 13:05:04 1985
  3257. Path: ut-sally!jsq
  3258. From: jsq@ut-sally.UUCP (John Quarterman)
  3259. Newsgroups: mod.std.unix
  3260. Subject: Re: standardized error messages
  3261. Message-Id: <2423@ut-sally.UUCP>
  3262. Date: 21 Jul 85 18:04:51 GMT
  3263. References: <2391@ut-sally.UUCP>
  3264. Reply-To: std-unix@ut-sally.UUCP
  3265. Organization: U. Texas CS Dept., Austin, Texas
  3266. Lines: 36
  3267. Approved: jsq@ut-sally.UUCP
  3268. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3269. Submissions-To:     ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3270. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3271. Uucp-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3272. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3273. Draft-9: 2.5 3.2
  3274.  
  3275. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  3276. Topic: standardizing exit codes
  3277.     It's not quite the same as standardized error messages,
  3278.     but close enough to keep in the same discussion.
  3279.  
  3280. ----------------------------------------------------------------------
  3281.  
  3282. Date: Sat, 20 Jul 85 16:52:04 PDT
  3283. From: seismo!sun!guy (Guy Harris)
  3284. To: ut-sally!std-unix
  3285. Subject: Standardizing exit codes
  3286.  
  3287. There is currently no universal standard for the meaning of exit codes,
  3288. except that 0 means "true" or "success" and non-zero means "false" or
  3289. "failure".  Some System V programs use 2 for syntax errors, failure to open
  3290. files, and the like, and 1 for "the command was run properly but gives a
  3291. result of 'false'".  "delivermail" and "sendmail" expect programs they run
  3292. to exit with an error code from the include file <sysexits.h> which has a
  3293. number of exit codes which further break down "failure to execute properly"
  3294. (like exit code 2 in those System V commands) into "incorrect usage", "input
  3295. data incorrect", "input file could not be opened", etc..
  3296.  
  3297. It might be useful to adopt some convention like that of <sysexits.h>.  Exit
  3298. code 0 would mean "the command executed without problems and returns a
  3299. 'true' result; exit codes from 1 to some number N1 - 1 would mean "the
  3300. command executed without problems and returns a 'false' result" - the exit
  3301. code could be used to further specify the type of "false" result, if
  3302. desired; exit codes from N1 to 254 could mean "the command did not execute
  3303. successfully" and the exit codes from <sysexits.h> could break this down
  3304. further; and exit code 255 would be reserved for forked-off child processes
  3305. which were supposed to "exec" something but the "exec" failed.  (In
  3306. <sysexits.h>, N1 has the value 64.)
  3307.  
  3308.     Guy Harris
  3309.  
  3310. ------------------------------
  3311.  
  3312. Volume-Number: Volume 1, Number 34
  3313.  
  3314. From jsq  Sun Jul 21 13:06:56 1985
  3315. Path: ut-sally!jsq
  3316. From: jsq@ut-sally.UUCP (John Quarterman)
  3317. Newsgroups: mod.std.unix
  3318. Subject: Non-blocking I/O and EWOULDBLOCK vs. EAGAIN
  3319. Message-Id: <2424@ut-sally.UUCP>
  3320. Date: 21 Jul 85 18:06:36 GMT
  3321. Reply-To: std-unix@ut-sally.UUCP
  3322. Organization: U. Texas CS Dept., Austin, Texas
  3323. Lines: 31
  3324. Approved: jsq@ut-sally.UUCP
  3325. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3326. Submissions-To:     ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3327. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3328. Uucp-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3329. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3330. Draft-9: 5.4 6.0
  3331.  
  3332. Date: Sat, 20 Jul 85 16:41:57 PDT
  3333. From: seismo!sun!guy (Guy Harris)
  3334. To: ut-sally!std-unix
  3335. Subject: Non-blocking I/O and EWOULDBLOCK vs. EAGAIN
  3336.  
  3337. The /usr/group standards committee has essentially adopted 4.2BSD-style
  3338. non-blocking I/O, rather than System V-style non-blocking I/O.  The System V
  3339. Interface Definition says that System V will be changed to match the
  3340. /usr/group standard.
  3341.  
  3342. However,
  3343.  
  3344.     1) as the S5ID states, this may break existing code as it isn't
  3345.        compatible with existing System V implementations.
  3346.  
  3347. and
  3348.  
  3349.     2) it's not compatible with 4.2BSD, either, because they return
  3350.        EAGAIN if a non-blocking operation would have blocked had the
  3351.        descriptor been in non-blocking mode, rather than EWOULDBLOCK.
  3352.  
  3353. Is there a good reason for constructing a new specification, incompatible
  3354. with *all* existing systems, rather than adopting the existing 4.2BSD
  3355. facility which provides the same functionality and merely uses a different
  3356. error code?  "The committee didn't want to add a new error code" is an
  3357. extremely bad reason, as they have already added new error codes for the
  3358. benefit of file locking.  UNIX error codes are far too overloaded already;
  3359. the problem should not be compounded.
  3360.  
  3361.     Guy Harris
  3362.  
  3363.  
  3364. Volume-Number: Volume 1, Number 35
  3365.  
  3366. From jsq  Tue Jul 23 10:50:07 1985
  3367. Path: ut-sally!jsq
  3368. From: jsq@ut-sally.UUCP (John Quarterman)
  3369. Newsgroups: mod.std.unix
  3370. Subject: Retransmissions and dead subjects.
  3371. Message-Id: <2439@ut-sally.UUCP>
  3372. Date: 23 Jul 85 15:49:55 GMT
  3373. Reply-To: std-unix@ut-sally.UUCP
  3374. Organization: U. Texas CS Dept., Austin, Texas
  3375. Lines: 28
  3376. Approved: jsq@ut-sally.UUCP
  3377. Draft-9: mod.std.unix
  3378.  
  3379. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  3380. Topic: Retransmissions and dead subjects.
  3381. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3382. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3383. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3384. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3385. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3386.  
  3387. The next four articles I will post to this newsgroup are retransmissions.
  3388. This is because, in an overly clever attempt to reduce the overhead of
  3389. the information formerly at the end of each article, I added the five
  3390. non-standard headers you now see included as part of the text above.
  3391. This is perfectly proper according to both the news article and mail
  3392. message format specifications.  However, some news (or notes) version
  3393. out there cannot handle either non-standard headers or sheer numbers
  3394. of headers and truncated all the articles which contained them.  Also,
  3395. as Robert Elz points out, most news reading programs will not display
  3396. the extra headers anyway unless the user explicitly asks for them.
  3397.  
  3398. Several people have complained that the getopt discussion is getting
  3399. overly verbose for the amount of information conveyed.  In particular,
  3400. implementation details of the standard I/O library are rather peripheral
  3401. to the standards effort, and would fit more readily in net.unix-wizards
  3402. or mod.unix than in mod.std.unix.  If you submit an article on getopt,
  3403. try to make it something new.  Better:  let's go on to other topics.
  3404.  
  3405. I am, however, still hoping someone will determine if there really is
  3406. a public domain AT&T getopt and submit it, if so.
  3407.  
  3408. Volume-Number: Volume 1, Number 36
  3409.  
  3410. From jsq  Tue Jul 23 12:40:08 1985
  3411. Path: ut-sally!jsq
  3412. From: jsq@ut-sally.UUCP (John Quarterman)
  3413. Newsgroups: mod.std.unix
  3414. Subject: Re: a bit more on getopt (retransmitted)
  3415. Message-Id: <2444@ut-sally.UUCP>
  3416. Date: 23 Jul 85 17:40:03 GMT
  3417. References: <251@mcc-db.UUCP> <2365@ut-sally.UUCP> <2392@ut-sally.UUCP> <2401@ut-sally.UUCP>
  3418. Reply-To: std-unix@ut-sally.UUCP
  3419. Organization: U. Texas CS Dept., Austin, Texas
  3420. Lines: 44
  3421. Approved: jsq@ut-sally.UUCP
  3422. Draft-9: 1003.2.getopt
  3423.  
  3424. ----------------------------------------------------------------------
  3425.  
  3426. From: seismo!BBN-LABS-B.ARPA!dan (Dan Franklin)
  3427. To: ut-sally!BBN-LABS-B.ARPA!std-unix
  3428. Subject: Re: a bit more on getopt
  3429. Date: 19 Jul 85 11:32:03 EDT (Fri)
  3430.  
  3431. >  > Actually this is important in some applications which do not already use
  3432. >  > stdio and do not wish to load in the 10k or so overhead that using stdio
  3433. >  > incurs. AT&T's code does not use stdio in getopt(3).
  3434. >  Not true.  The size difference between:
  3435. >      main() { puts("foo"); }
  3436. >  and
  3437. >      main() { write(0,"foo",3); }
  3438. >  is exactly zero.
  3439.  
  3440. Your second one-liner is still using stdio.  The difference between
  3441.        main() { puts("foo"); }
  3442. and
  3443.        main() { write(1, "foo", 3); }   exit(n) { _exit(n); }
  3444. on the other hand, is substantial, at least on my 4.2 VAX system (and, in my
  3445. experience, on other UNIX systems as well):
  3446.  
  3447. text    data    bss    dec    hex
  3448. 2048    1024    15988    19060    4a74    stdio
  3449. 1024    1024    0     2048     800    nostdio
  3450.  
  3451. 1024       0    25988   17012           difference
  3452.  
  3453. The point about not using stdio in a library routine if it's not necessary
  3454. still stands.
  3455.  
  3456.     Dan Franklin
  3457.  
  3458. ------------------------------
  3459.  
  3460. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3461. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3462. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3463. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3464. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3465.  
  3466. Volume-Number: Volume 1, Number 37
  3467.  
  3468. From jsq  Tue Jul 23 12:41:51 1985
  3469. Path: ut-sally!jsq
  3470. From: jsq@ut-sally.UUCP (John Quarterman)
  3471. Newsgroups: mod.std.unix
  3472. Subject: Re: a bit more on getopt (retransmitted)
  3473. Message-Id: <2445@ut-sally.UUCP>
  3474. Date: 23 Jul 85 17:41:46 GMT
  3475. References: <251@mcc-db.UUCP> <2365@ut-sally.UUCP> <2392@ut-sally.UUCP> <2401@ut-sally.UUCP> <2409@ut-sally.UUCP>
  3476. Reply-To: std-unix@ut-sally.UUCP
  3477. Organization: U. Texas CS Dept., Austin, Texas
  3478. Lines: 220
  3479. Approved: jsq@ut-sally.UUCP
  3480. Draft-9: 1003.2.getopt
  3481.  
  3482. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  3483. Topic: command line arguments (getopt) (retransmission of earlier article)
  3484.     Is the AT&T getopt public domain, or just published?
  3485.     AT&T getopt(3) man page is inaccurate.
  3486.     Inclusion of stdio and size of programs.
  3487.     Options, white space, and shell scripts.
  3488.     Full word command names and arguments, and completion.
  3489.  
  3490. ----------------------------------------------------------------------
  3491.  
  3492. From: ihnp4!utzoo!henry (Henry Spencer)
  3493. Date: 19 Jul 85 20:14:44 CDT (Fri)
  3494. To: ihnp4!seismo!ut-sally!std-unix
  3495. Subject: Is AT&T getopt public-domain?  Not clear!
  3496.  
  3497. The document I have from the /usr/group standards meeting at Dallas
  3498. does *not* say that the AT&T getopt is being made public domain.  What
  3499. it says is:
  3500.  
  3501.     The [getopt] source code is being published by AT&T Bell
  3502.     Laboratories to encourage adherence to the command syntax
  3503.     standard and to satisfy requests from [everyone in sight].
  3504.  
  3505. Note that publishing something does *not* put it into the public domain
  3506. unless this is stated explicitly.  That may have been AT&T's intent, but
  3507. they didn't say it that way.  The document in question includes the AT&T
  3508. source, but I am reluctant to submit it to mod.std.unix until its status
  3509. is clarified.
  3510.  
  3511.                 Henry Spencer @ U of Toronto Zoology
  3512.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  3513.  
  3514. ------------------------------
  3515.  
  3516. Date: 20 Jul 85 11:03:28 EDT (Sat)
  3517. From: topaz!packard!nomad!ggr (Guy Riddle)
  3518. Subject: getopt: the Code vs. the Manual Page
  3519. To: ut-sally!std-unix
  3520. Cc: seismo!keith
  3521.  
  3522. I hope you haven't been modelling the 4.3 version of getopt(3) too
  3523. closely after the SVR2 manual page, for it lies about the details.
  3524.  
  3525. It states
  3526.  
  3527.     "Because optind is external, it is normally initialized to
  3528.     zero automatically before the first call to getopt."
  3529.  
  3530. Well, I'll grant that optind is external, but it is initialized to one.
  3531.  
  3532. Also, the claim that
  3533.  
  3534.     "This error message may be disabled by setting opterr
  3535.     to a non-zero value."
  3536.  
  3537. is also a lie.  Opterr is initialized to one, and to disable the error
  3538. message you must set it to zero.
  3539.  
  3540.         === Guy Riddle == AT&T Bell Laboratories, New Jersey ===
  3541.  
  3542. ----------
  3543. |Rebuttal
  3544. |Corner
  3545. |
  3546.     Keith's assertion that
  3547.  
  3548.     > Not true.  The size difference between:
  3549.     > 
  3550.     >     main() { puts("foo"); }
  3551.     > and
  3552.     >     main() { write(0,"foo",3); }
  3553.     > 
  3554.     > is exactly zero.
  3555.  
  3556.     might be valid for 4.2, but it's not for SVR2, where the size of the
  3557.     puts(3) version is
  3558.  
  3559.         2432 + 456 + 2232 = 5120
  3560.  
  3561.     while the write(2) version is only
  3562.  
  3563.         128 + 12 + 0 = 140
  3564.  
  3565. ------------------------------
  3566.  
  3567. From: ihnp4!decvax!borman (Dave Borman)
  3568. Date: Sat, 20 Jul 85 21:01:42 edt
  3569. To: decvax!ihnp4!ut-sally!std-unix
  3570. Subject: getopt(3) & stdio
  3571.  
  3572. >  >  > Actually this is important in some applications which do not already use
  3573. >  >  > stdio and do not wish to load in the 10k or so overhead that using stdio
  3574. >  >  > incurs. AT&T's code does not use stdio in getopt(3).
  3575. >  > 
  3576. >  >  Not true.  The size difference between:
  3577. >  > 
  3578. >  >      main() { puts("foo"); }
  3579. >  >  and
  3580. >  >      main() { write(0,"foo",3); }
  3581. >  > 
  3582. >  >  is exactly zero.
  3583. >  
  3584. >  Your second one-liner is still using stdio.  The difference between
  3585. >     main() { puts("foo"); }
  3586. >  and
  3587. >     main() { write(1, "foo", 3); }   exit(n) { _exit(n); }
  3588. >  on the other hand, is substantial, at least on my 4.2 VAX system (and, in my
  3589. >  experience, on other UNIX systems as well):
  3590.  
  3591. The first two examples are different, the puts() will pull in stdio and
  3592. the write() should not.  If you have to explicitly re-declare exit() to
  3593. avoid pulling in the stdio package, then your /lib/libc.a is mucked up.
  3594. exit() calls _cleanup, of which there are two copies in the /lib/libc.a.
  3595. The stdio package has a function _cleanup which flushes all the buffers.
  3596. There is also a dummy _cleanup routine (usually fakcu.s) which just
  3597. returns.  In /lib/libc.a, exit() must be archived after all the stdio
  3598. functions, and the dummy _cleanup must be archived after exit.  If you
  3599. have exit() before the stdio functions, then the reference to _cleanup
  3600. will pull in the whole stdio package.  If exit() is after the stdio
  3601. package and the dummy _cleanup after exit(), then if you don't reference
  3602. any stdio functions you will only pull in the dummy cleanup routine.
  3603.  
  3604.         -Dave Borman, Digital UNIX Engineering Group.
  3605.         decvax!borman
  3606.  
  3607. ------------------------------
  3608.  
  3609. Date: Sat, 20 Jul 85 16:31:33 PDT
  3610. From: seismo!sun!guy (Guy Harris)
  3611. To: ut-sally!jsq
  3612. Subject: Re: a bit more on getopt
  3613.  
  3614. > Not true.  The size difference between:
  3615. >
  3616. >    main() { puts("foo"); }
  3617. > and
  3618. >    main() { write(0,"foo",3); }
  3619. >
  3620. > is exactly zero.
  3621.  
  3622. Only true on certain UNIX implementations.  Under Sun UNIX 2.0
  3623. (4.2BSD-based), there is a slight difference.  Under System V there is a
  3624. significant difference.  The problem is that 4.2BSD *always* drags in the
  3625. Standard I/O Library while System V doesn't.  4.xBSD could be changed, with
  3626. about 30 minutes work, to work the way System V does here, so the assumption
  3627. should be made that the Standard I/O Library does consume a nonzero amount
  3628. of code and data space.  (About 13788 bytes in one test I did; this doesn't
  3629. count buffers which are "malloc"ed when the first read/write is done.)
  3630.  
  3631.     Guy Harris
  3632.  
  3633. ------------------------------
  3634.  
  3635. From: ihnp4!utzoo!henry (Henry Spencer)
  3636. Date: 20 Jul 85 20:45:50 CDT (Sat)
  3637. To: ihnp4!seismo!ut-sally!std-unix
  3638. Subject: Re: a bit more on getopt
  3639. References: <251@mcc-db.UUCP> <2365@ut-sally.UUCP> <2392@ut-sally.UUCP>, <2399@ut-sally.UUCP>
  3640.  
  3641. > > ...  The "-t/dev/tty" example is an easy one
  3642. > > to pick out, but what about "-dfaglop"?  Which of those letters are
  3643. > > options, and which are an option argument?
  3644. > OK, instead of forcing whitespace, how about requiring that there only be one
  3645. > flag if you are going to do this sort of stuff? I have had shell scripts
  3646. > totally broken by this requirement, and workarounds take up so much overhead
  3647. > (yes, some people have systems smaller than vaxen) that it's not worth the
  3648. > hassle.
  3649.  
  3650. We do a *lot* of shell programming, and our experience is that the
  3651. separating blank makes life easier, not harder.  Of course, we generally
  3652. use getopt(1) for the argument parsing, which makes life simpler.  utzoo
  3653. is a PDP11, by the way.
  3654.  
  3655.                 Henry Spencer @ U of Toronto Zoology
  3656.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  3657.  
  3658. ------------------------------
  3659.  
  3660. From: ihnp4!utzoo!henry (Henry Spencer)
  3661. Date: 19 Jul 85 20:15:23 CDT (Fri)
  3662. To: ihnp4!seismo!ut-sally!std-unix
  3663. Subject: Command lines
  3664.  
  3665. > It's probably way too late for this to be suggested, but the longer it's
  3666. > left, the worse it will be.
  3667. > How about completely revamping the unix command line syntax to be
  3668. >     command {{-option ...} {file ...} ...}
  3669. > with command names & option names being full words (e.g. remove, not rm)...
  3670.  
  3671. The AT&T command-line-syntax people have alluded to attempts to do this
  3672. in the past at AT&T.  They were failures.  It is not enough to decree a
  3673. standard; one must also convince people to accept it.  The getopt standard
  3674. has been widely accepted precisely *because* it tidies up and standardizes
  3675. the existing situation, rather than trying to impose radical change.
  3676.  
  3677. There are also problems with full-word options, and worse problems with
  3678. full-word options that can be arbitrarily abbreviated, but I won't get
  3679. into that since it seems a digression.
  3680.  
  3681. I've thought about this at considerable length, and concluded that radical
  3682. change will require more incentive than a simplistic revision of command
  3683. syntax would provide.  VMS-style "completion" isn't enough.  What one wants
  3684. is much more sophisticated help in command construction, including things
  3685. like interactive "help" information for options, knowledge of the semantics
  3686. of arguments so that error repair can be applied, etc.  Imbedding this into
  3687. every program seems dubious; it would seem better to have a sophisticated
  3688. shell which uses a database describing the commands.  Note that such an
  3689. interface could completely hide the details of the *actual* command syntax.
  3690. Someday...
  3691.                 Henry Spencer @ U of Toronto Zoology
  3692.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  3693.  
  3694. ------------------------------
  3695.  
  3696. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3697. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3698. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3699. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3700. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3701.  
  3702. Volume-Number: Volume 1, Number 38
  3703.  
  3704. From jsq  Tue Jul 23 12:43:39 1985
  3705. Path: ut-sally!jsq
  3706. From: jsq@ut-sally.UUCP (John Quarterman)
  3707. Newsgroups: mod.std.unix
  3708. Subject: Re: standardized error messages (retransmitted)
  3709. Message-Id: <2446@ut-sally.UUCP>
  3710. Date: 23 Jul 85 17:43:34 GMT
  3711. References: <2391@ut-sally.UUCP>
  3712. Reply-To: std-unix@ut-sally.UUCP
  3713. Organization: U. Texas CS Dept., Austin, Texas
  3714. Lines: 42
  3715. Approved: jsq@ut-sally.UUCP
  3716. Draft-9: 2.5 3.2
  3717.  
  3718. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  3719. Topic: standardizing exit codes
  3720.     It's not quite the same as standardized error messages,
  3721.     but close enough to keep in the same discussion.
  3722.  
  3723. ----------------------------------------------------------------------
  3724.  
  3725. Date: Sat, 20 Jul 85 16:52:04 PDT
  3726. From: seismo!sun!guy (Guy Harris)
  3727. To: ut-sally!std-unix
  3728. Subject: Standardizing exit codes
  3729.  
  3730. There is currently no universal standard for the meaning of exit codes,
  3731. except that 0 means "true" or "success" and non-zero means "false" or
  3732. "failure".  Some System V programs use 2 for syntax errors, failure to open
  3733. files, and the like, and 1 for "the command was run properly but gives a
  3734. result of 'false'".  "delivermail" and "sendmail" expect programs they run
  3735. to exit with an error code from the include file <sysexits.h> which has a
  3736. number of exit codes which further break down "failure to execute properly"
  3737. (like exit code 2 in those System V commands) into "incorrect usage", "input
  3738. data incorrect", "input file could not be opened", etc..
  3739.  
  3740. It might be useful to adopt some convention like that of <sysexits.h>.  Exit
  3741. code 0 would mean "the command executed without problems and returns a
  3742. 'true' result; exit codes from 1 to some number N1 - 1 would mean "the
  3743. command executed without problems and returns a 'false' result" - the exit
  3744. code could be used to further specify the type of "false" result, if
  3745. desired; exit codes from N1 to 254 could mean "the command did not execute
  3746. successfully" and the exit codes from <sysexits.h> could break this down
  3747. further; and exit code 255 would be reserved for forked-off child processes
  3748. which were supposed to "exec" something but the "exec" failed.  (In
  3749. <sysexits.h>, N1 has the value 64.)
  3750.  
  3751.     Guy Harris
  3752.  
  3753. ------------------------------
  3754.  
  3755. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3756. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3757. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3758. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3759. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3760.  
  3761. Volume-Number: Volume 1, Number 39
  3762.  
  3763. From jsq  Tue Jul 23 12:46:24 1985
  3764. Path: ut-sally!jsq
  3765. From: jsq@ut-sally.UUCP (John Quarterman)
  3766. Newsgroups: mod.std.unix
  3767. Subject: Non-blocking I/O and EWOULDBLOCK vs. EAGAIN (retransmitted)
  3768. Message-Id: <2447@ut-sally.UUCP>
  3769. Date: 23 Jul 85 17:46:19 GMT
  3770. Reply-To: std-unix@ut-sally.UUCP
  3771. Organization: U. Texas CS Dept., Austin, Texas
  3772. Lines: 40
  3773. Approved: jsq@ut-sally.UUCP
  3774. Draft-9: 5.4 6.0
  3775.  
  3776. ----------------------------------------------------------------------
  3777.  
  3778. Date: Sat, 20 Jul 85 16:41:57 PDT
  3779. From: seismo!sun!guy (Guy Harris)
  3780. To: ut-sally!std-unix
  3781. Subject: Non-blocking I/O and EWOULDBLOCK vs. EAGAIN
  3782.  
  3783. The /usr/group standards committee has essentially adopted 4.2BSD-style
  3784. non-blocking I/O, rather than System V-style non-blocking I/O.  The System V
  3785. Interface Definition says that System V will be changed to match the
  3786. /usr/group standard.
  3787.  
  3788. However,
  3789.  
  3790.     1) as the S5ID states, this may break existing code as it isn't
  3791.        compatible with existing System V implementations.
  3792.  
  3793. and
  3794.  
  3795.     2) it's not compatible with 4.2BSD, either, because they return
  3796.        EAGAIN if a non-blocking operation would have blocked had the
  3797.        descriptor been in non-blocking mode, rather than EWOULDBLOCK.
  3798.  
  3799. Is there a good reason for constructing a new specification, incompatible
  3800. with *all* existing systems, rather than adopting the existing 4.2BSD
  3801. facility which provides the same functionality and merely uses a different
  3802. error code?  "The committee didn't want to add a new error code" is an
  3803. extremely bad reason, as they have already added new error codes for the
  3804. benefit of file locking.  UNIX error codes are far too overloaded already;
  3805. the problem should not be compounded.
  3806.  
  3807.     Guy Harris
  3808.  
  3809. ------------------------------
  3810.  
  3811. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3812. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3813. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3814. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3815. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3816.  
  3817. Volume-Number: Volume 1, Number 40
  3818.  
  3819. From jsq  Wed Jul 24 11:16:17 1985
  3820. Path: ut-sally!jsq
  3821. From: jsq@ut-sally.UUCP (John Quarterman)
  3822. Newsgroups: mod.std.unix
  3823. Subject: Re: standardized error messages
  3824. Message-Id: <2461@ut-sally.UUCP>
  3825. Date: 24 Jul 85 16:15:55 GMT
  3826. References: <2391@ut-sally.UUCP>
  3827. Reply-To: std-unix@ut-sally.UUCP
  3828. Organization: U. Texas CS Dept., Austin, Texas
  3829. Lines: 36
  3830. Approved: jsq@ut-sally.UUCP
  3831. Draft-9: 2.5
  3832.  
  3833. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  3834. Topic: Re: standardized error messages
  3835.  
  3836. ----------------------------------------------------------------------
  3837.  
  3838. From: oliveb!jerry@fortune.uucp (Jerry Aguirre)
  3839. Date: Mon, 22 Jul 85 21:42:10 pdt
  3840. Subject: Re: standardized error messages
  3841. References: <2391@ut-sally.UUCP>
  3842.  
  3843. > From: Mike Trachtman  <wizard%wisdom.bitnet@WISCVM.ARPA>
  3844. > Is any thought being given to having the compilers, grep, etc.
  3845. > give error messages in a standard form, so
  3846. > that programs will be able to parse them.
  3847.  
  3848. The sys V announcment that I attended included discussion not only of
  3849. getopt but of an error library routine.
  3850.  
  3851. I don't have the syntax handy but it included the severity of the error
  3852. (warning vs. error vs. fatal), a user supplied message, and optionally
  3853. the errno determined system error message.
  3854.  
  3855. I have seen several postings of source which use a similar routine.
  3856. Does anyone at ATT care to comment on whether an error routine will be
  3857. included and what the syntax is?
  3858.  
  3859.                 Jerry Aguirre @ Olivetti ATC
  3860. {hplabs|fortune|idi|ihnp4|tolerant|allegra|tymix}!oliveb!jerry
  3861.  
  3862. ------------------------------
  3863.  
  3864. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3865. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3866. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3867. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3868. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3869.  
  3870. Volume-Number: Volume 1, Number 41
  3871.  
  3872. From jsq  Thu Jul 25 09:55:37 1985
  3873. Path: ut-sally!jsq
  3874. From: jsq@ut-sally.UUCP (John Quarterman)
  3875. Newsgroups: mod.std.unix
  3876. Subject: Re: standardized error messages
  3877. Message-Id: <2474@ut-sally.UUCP>
  3878. Date: 25 Jul 85 14:55:26 GMT
  3879. References: <2391@ut-sally.UUCP> <2461@ut-sally.UUCP>
  3880. Reply-To: std-unix@ut-sally.UUCP
  3881. Organization: U. Texas CS Dept., Austin, Texas
  3882. Lines: 47
  3883. Approved: jsq@ut-sally.UUCP
  3884. Draft-9: 2.5
  3885.  
  3886. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  3887. Topic: Re: standardized error messages
  3888.  
  3889. ----------------------------------------------------------------------
  3890.  
  3891. Date: Sun, 21 Jul 85 05:19:11 pdt
  3892. From: seismo!nsc!daisy!david (David Schachter)
  3893. To: ut-sally!jsq
  3894. Subject: Re: standardized error messages
  3895. In-Reply-To: <2391@ut-sally.UUCP>
  3896.  
  3897. Daisy's version of the UNIX(tm) operating system has a standard
  3898. way of handling error reporting.  You call a system routine,
  3899. passing it an error file number and an error status.  You also
  3900. pass a flag saying how to handle the error and substitution var-
  3901. iables.  The system looks up the error file number in a table to 
  3902. get the names of the error file.  It then looks up in the file the
  3903. appropriate error message, using a simple transformation of the
  3904. error status as the key.  The strings in the error file are sim-
  3905. ilar in format to the 'printf' function thus allowing you to
  3906. substitute variables into the error message.
  3907.  
  3908. The flag you pass tells the system whether to display the message,
  3909. add it to the stack, display the entire stack (clearing it), or
  3910. jump to the machine monitor with a fatal error.  Obviously, the
  3911. latter case is used only when the error is on the order of "system
  3912. corrupt."
  3913.   
  3914. You can also pass an error port id if you do not wish the message
  3915. to go to std_err.
  3916.   
  3917. A subtle advantage of this is that all error messages reside in
  3918. external text files, not compiled into the code of the programs.
  3919. This results in faster loading, less memory usage, and makes it
  3920. easy to change error messages and to enforce consistent style.
  3921.   
  3922. [This does not represent official policy by Daisy Systems.  The
  3923. author speaks only for himself.] {"Where there's a will, there's
  3924. a won't."}
  3925.  
  3926. ------------------------------
  3927.  
  3928. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3929. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3930. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3931. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3932. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3933.  
  3934. Volume-Number: Volume 1, Number 42
  3935.  
  3936. From jsq  Fri Jul 26 12:48:51 1985
  3937. Path: ut-sally!jsq
  3938. From: jsq@ut-sally.UUCP (John Quarterman)
  3939. Newsgroups: mod.std.unix
  3940. Subject: Command completion in csh/sh
  3941. Message-Id: <2484@ut-sally.UUCP>
  3942. Date: 26 Jul 85 17:48:39 GMT
  3943. Reply-To: std-unix@ut-sally.UUCP
  3944. Organization: U. Texas CS Dept., Austin, Texas
  3945. Lines: 35
  3946. Approved: jsq@ut-sally.UUCP
  3947. Draft-9: 1003.2.getopt
  3948.  
  3949. ----------------------------------------------------------------------
  3950.  
  3951. Date: Thu, 25 Jul 85 08:28:34 pdt
  3952. From: ihnp4!celerity!barto
  3953. To: bang!ihnp4!ut-sally!std-unix
  3954. Subject: Command completion in csh/sh
  3955.  
  3956. I have taken the twenex command completion code from the csh as
  3957. posted quite some time ago, and integrated it into the bourne shell
  3958. as distributed for V.2 from BRL.
  3959.  
  3960. Thus command completion now exists for the bourne shell.  These mods
  3961. will be made available to the general public through gatech!arnold.
  3962. (PLEASE DONT BOTHER HIM ABOUT THEM NOW.  THEY WILL BE POSTED WHEN HE
  3963. IS READY TO! And don't bug me about them, as I will only tell you to
  3964. wait until the posting from Arnold is ready.)
  3965.  
  3966. This is just to let all of you out there know that we have not forgotten
  3967. the 'standard shell' users.
  3968.  
  3969. -- 
  3970. David Barto, Celerity Computing, San Diego Ca, (619) 271-9940
  3971. decvax-\    bang-\            ARPA: celerity!barto@sdcsvax.ARPA
  3972. ucbvax--\   akgua-\
  3973. ihnp4----\-sdcsvax-\-celerity!barto
  3974.  
  3975.     "There are no moral lessons in nature" - Darwin
  3976.  
  3977. ------------------------------
  3978.  
  3979. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  3980. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  3981. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  3982. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  3983. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  3984.  
  3985. Volume-Number: Volume 1, Number 43
  3986.  
  3987. From jsq  Thu Aug  1 15:43:56 1985
  3988. Path: ut-sally!jsq
  3989. From: jsq@ut-sally.UUCP (John Quarterman)
  3990. Newsgroups: mod.std.unix
  3991. Subject: Re: standardized error messages
  3992. Message-Id: <2560@ut-sally.UUCP>
  3993. Date: 1 Aug 85 20:43:46 GMT
  3994. References: <2391@ut-sally.UUCP> <2461@ut-sally.UUCP> <2474@ut-sally.UUCP>
  3995. Reply-To: std-unix@ut-sally.UUCP
  3996. Organization: U. Texas CS Dept., Austin, Texas
  3997. Lines: 134
  3998. Approved: jsq@ut-sally.UUCP
  3999. Summary: if this doesn't get standardized, everybody will do it anyway
  4000. Draft-9: 2.5
  4001.  
  4002. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  4003. Topic: standardized error messages
  4004.  
  4005. ----------------------------------------------------------------------
  4006.  
  4007. From: oakhill!mot!fred (Fred Christiansen)
  4008. Date: Fri, 26 Jul 85 16:19:00 cdt
  4009. To: oakhill!ut-sally!jsq@tzec.UTEXAS.ARPA
  4010. Subject: Re: standardized error messages
  4011.  
  4012. the SVID has specifics in Appendix BASE 5.6 (p. 341), which i shall attempt
  4013. to summarize:
  4014.     the std error msg has 5 parts:
  4015.         Label        who's issuing this msg
  4016.         Severity    4 possible codes (halt, error, warning, fyi)
  4017.         Problem        what went wrong
  4018.         Action        "TO FIX" do such and such
  4019.         Tag        unique error msg id which can be used to
  4020.                 track down more info
  4021.  
  4022. Fred Christiansen ("Canajun, eh?") @ Motorola Microsystems, Tempe, AZ
  4023. UUCP:  ihnp4!{attunix, btlunix, drivax, sftig, ut-sally!oakhill}!mot!fred
  4024. ARPA:  oakhill!mot!fred@ut-sally.ARPA             AT&T:  602-438-3472
  4025.  
  4026. ------------------------------
  4027.  
  4028. From: Mike Trachtman  <wizard%wisdom.bitnet@WISCVM.ARPA>
  4029. Date: Sun, 28 Jul 85 14:59:04 -0200
  4030. To: std-unix@ut-sally.arpa
  4031. Subject: standard error messages.
  4032.  
  4033. A standard for error messages should be very strict about punctuation,
  4034. and where line numbers go.
  4035. somthing like
  4036.  
  4037. command: filename (linenumber) - severity - message
  4038.  
  4039. this is getting kind of IBMsh, but programs should be able
  4040. to parse errors, and thus errors should be in a standard form.
  4041.  
  4042. errors should definitely include the following
  4043.  
  4044. 1) the filename where the error was
  4045. 2) the line number
  4046. 3) the error, (or in greps case, the line that contained the word
  4047.  
  4048. optionally, but in a set format
  4049.  
  4050. 1) the command or routine that found the error
  4051. 2) the Unix errno
  4052. 3) some program generated error number
  4053. 4) an indication of the severity
  4054.  
  4055. Of course, these are only opinions, and they are only my opinions.
  4056. Mike
  4057.  
  4058.         wizard@wisdom                           (BITNET)
  4059.         wizard%wisdom.bitnet@wiscvm.ARPA        (ARPA/CSNET)
  4060.         wizard%wisdom.bitnet@berkley            (ARPA/CSNET)
  4061. and if all else fails (ONLY for VERY short items)
  4062.         ...!decvax!humus!wisdom!wizard          (UUCP)
  4063.  
  4064. ------------------------------
  4065.  
  4066. Date: Wed, 24 Jul 85 16:18:22 edt
  4067. From: Chris Torek <chris@maryland>
  4068. To: std-unix@ut-sally
  4069. Subject: Re: standardized error messages
  4070.  
  4071. Hm.  It's probably too late, but I would suggest that any standard
  4072. library routine for printing error message use printf-style
  4073. conversions (preferably it should be exactly like printf once you
  4074. get past severity stuff and whatnot).
  4075.  
  4076. In case anyone wants it, here's the routine I installed in our C
  4077. library on our "experimental" machine (it wants a bit of support
  4078. in the startup code to set _argv0 to argv[0], so that the program
  4079. name is included in error messages, but will work without it).  It
  4080. is not (alas!) portable, but can be made to work on any of the
  4081. popular Unix machines.  (I have a manual entry, if anyone cares.)
  4082.  
  4083. Chris
  4084.  
  4085. #include <stdio.h>
  4086.  
  4087. char *_argv0;            /* argv[0], set by C startup code */
  4088.  
  4089. /*
  4090.  * error - University of Maryland specific (sigh)
  4091.  *
  4092.  * Useful for printing error messages.  Will print the program name
  4093.  * and (optionally) the system error associated with the values in
  4094.  * <errno.h>.
  4095.  *
  4096.  * Note that the type (and even the existence!) of ``arg'' is undefined.
  4097.  */
  4098. error(quit, e, fmt, arg)
  4099.     int quit;
  4100.     register int e;
  4101.     char *fmt;
  4102. {
  4103.     extern char *sys_errlist[];
  4104.     extern int sys_nerr;
  4105.     register char *p = _argv0;
  4106.  
  4107.     if (p != NULL) {
  4108. #ifdef optional
  4109.         char *s, *rindex();
  4110.  
  4111.         if ((s = rindex(p, '/')) != NULL)
  4112.             p = s + 1;
  4113. #endif
  4114.         (void) fprintf(stderr, "%s: ", p);
  4115.     }
  4116.     _doprnt(fmt, &arg, stderr);    /* magic */
  4117.     if (e > 0) {
  4118.         p = e < sys_nerr ? sys_errlist[e] : "unknown error";
  4119.         (void) fprintf(stderr, ": %s", p);
  4120.     }
  4121.     (void) putc('\n', stderr);
  4122.     (void) fflush(stderr);
  4123.     if (quit)
  4124.         exit(quit);
  4125. }
  4126.  
  4127. ------------------------------
  4128.  
  4129. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4130. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4131. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4132. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4133. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4134.  
  4135.  
  4136.  
  4137. Volume-Number: Volume 1, Number 44
  4138.  
  4139. From jsq  Thu Aug  1 15:46:11 1985
  4140. Path: ut-sally!jsq
  4141. From: jsq@ut-sally.UUCP (John Quarterman)
  4142. Newsgroups: mod.std.unix
  4143. Subject: Storage allocators
  4144. Message-Id: <2561@ut-sally.UUCP>
  4145. Date: 1 Aug 85 20:46:03 GMT
  4146. Reply-To: std-unix@ut-sally.UUCP
  4147. Organization: U. Texas CS Dept., Austin, Texas
  4148. Lines: 30
  4149. Keywords: stack allocation, standardizing undocumented features
  4150. Approved: jsq@ut-sally.UUCP
  4151. Draft-9: 8.1
  4152.  
  4153. ----------------------------------------------------------------------
  4154.  
  4155. Date: Wed, 31 Jul 85 13:14:10 edt
  4156. From: Arnold Robbins <gatech!arnold>
  4157. Subject: Storage allocators
  4158. To: cbosgd!std-c, ut-sally!std-unix
  4159. Keywords: stack allocation, standardizing undocumented features
  4160.  
  4161. Unix has long had an undocumented routine alloca(), which allocates
  4162. storage off the stack.  This storage then goes away when the function
  4163. returns.
  4164.  
  4165. I would like to see this documented in the Unix standard under development,
  4166. and also included in the new ANSI C standard.  I would suggest that
  4167. the name get changed to something like salloc() [stack alloc], with
  4168. semantics similar to malloc (returned storage probably initialized to
  4169. garbage), only the storage is temporary, not permanent.
  4170.  
  4171. I think that cross posting to both groups is appropriate, since C supports
  4172. variables on the stack, so I doubt that there are many machines which can't
  4173. do alloca(), and for Unix, it comes down to documenting something that
  4174. has been there for a long time.
  4175.  
  4176. ------------------------------
  4177.  
  4178. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4179. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4180. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4181. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4182. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4183.  
  4184. Volume-Number: Volume 1, Number 45
  4185.  
  4186. From jsq  Sun Aug  4 13:16:49 1985
  4187. Path: ut-sally!jsq
  4188. From: jsq@ut-sally.UUCP (John Quarterman)
  4189. Newsgroups: mod.std.unix
  4190. Subject: Re: Storage allocators
  4191. Message-Id: <2579@ut-sally.UUCP>
  4192. Date: 4 Aug 85 18:16:43 GMT
  4193. References: <2561@ut-sally.UUCP>
  4194. Reply-To: std-unix@ut-sally.UUCP
  4195. Organization: U. Texas CS Dept., Austin, Texas
  4196. Lines: 21
  4197. Keywords: stack allocation, standardizing undocumented features
  4198. Approved: jsq@ut-sally.UUCP
  4199. Draft-9: 8.1
  4200.  
  4201. ----------------------------------------------------------------------
  4202.  
  4203. Date:     Fri, 2 Aug 85 17:37:19 EDT
  4204. From: Doug Gwyn <gwyn@BRL.ARPA>
  4205. To: arnold%gatech.uucp@BRL-TGR.ARPA
  4206. Cc: std-unix@UT-SALLY.ARPA, std-c%cbosgd.uucp@BRL-TGR.ARPA
  4207. Subject:  Re: alloca()
  4208.  
  4209. No!  It is not always possible to implement alloca().  Neither Gould
  4210. nor I could make it work on UTX-32.  We very definitely do not need
  4211. this sort of critter in any standards!
  4212.  
  4213. (It also adds no functionality and encourages sloppy coding practice.)
  4214.  
  4215. ------------------------------
  4216.  
  4217. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4218. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4219. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4220. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4221. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4222.  
  4223. Volume-Number: Volume 1, Number 46
  4224.  
  4225. From jsq  Sun Aug  4 13:21:11 1985
  4226. Path: ut-sally!jsq
  4227. From: jsq@ut-sally.UUCP (John Quarterman)
  4228. Newsgroups: mod.std.unix
  4229. Subject: Re: standardized error messages
  4230. Message-Id: <2580@ut-sally.UUCP>
  4231. Date: 4 Aug 85 18:21:06 GMT
  4232. References: <2391@ut-sally.UUCP> <2461@ut-sally.UUCP>
  4233. Reply-To: std-unix@ut-sally.UUCP
  4234. Organization: U. Texas CS Dept., Austin, Texas
  4235. Lines: 27
  4236. Approved: jsq@ut-sally.UUCP
  4237. Draft-9: 1003.2.getopt 2.5
  4238.  
  4239. ----------------------------------------------------------------------
  4240.  
  4241. Date: Wed, 31 Jul 85 00:34:17 mdt
  4242. From: seismo!cmcl2!lanl!unmvax!unmc!galway (Denis McKeon)
  4243. To: ut-sally!std-unix
  4244. Subject: Re: getopt standard reference
  4245.  
  4246. I don't have machine readable version of Hemenway & Armitage 
  4247. presentation, but their article in UNIX/World Vol. 1 No. 3
  4248. covers the choices, tradeoffs, & arguments well, and should be widely
  4249. available in the community. Perhaps U/w could post the copy?
  4250.  
  4251. dm
  4252.  
  4253.  
  4254. Denis McKeon, P.O. Box 4925, Albuquerque, NM 87196
  4255.  
  4256.     ~{convex,ucbvax,gatech,csu-cs,anl-mcs}!unmvax!unmc!galway
  4257.     ~{pur-ee!purdue,ucbvax!lbl-csam,philabs!cmcl2}!lanl!unmc!galway
  4258.  
  4259. ------------------------------
  4260.  
  4261. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4262. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4263. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4264. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4265. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4266.  
  4267. Volume-Number: Volume 1, Number 47
  4268.  
  4269. From jsq  Mon Aug  5 10:12:34 1985
  4270. Path: ut-sally!jsq
  4271. From: jsq@ut-sally.UUCP (John Quarterman)
  4272. Newsgroups: mod.std.unix
  4273. Subject: Re: Storage allocators
  4274. Message-Id: <2590@ut-sally.UUCP>
  4275. Date: 5 Aug 85 15:12:28 GMT
  4276. References: <2561@ut-sally.UUCP> <2579@ut-sally.UUCP>
  4277. Reply-To: std-unix@ut-sally.UUCP
  4278. Organization: U. Texas CS Dept., Austin, Texas
  4279. Lines: 22
  4280. Approved: jsq@ut-sally.UUCP
  4281. Draft-9: 8.1
  4282.  
  4283. ----------------------------------------------------------------------
  4284.  
  4285. Date: Mon, 5 Aug 85 10:04:43 edt
  4286. From: Arnold Robbins <gatech!arnold>
  4287. To: gwyn@brl.arpa
  4288. Subject: Re: alloca()
  4289. Cc: cbosgd!std-c, ut-sally!std-unix
  4290.  
  4291. Well, I just sort of liked the idea of using storage on the stack. It
  4292. is really nice for dynamic arrays.  I'll agree that it can lead to poor
  4293. coding practices.  The Gould must have a very interesting architecture
  4294. if alloca wouldn't work on it.
  4295.  
  4296. Arnold
  4297.  
  4298. ------------------------------
  4299.  
  4300. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4301. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4302. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4303. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4304. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4305.  
  4306. Volume-Number: Volume 1, Number 48
  4307.  
  4308. From jsq  Mon Aug  5 12:46:45 1985
  4309. Path: ut-sally!jsq
  4310. From: jsq@ut-sally.UUCP (John Quarterman)
  4311. Newsgroups: mod.std.unix
  4312. Subject: Re: Storage allocators
  4313. Message-Id: <2592@ut-sally.UUCP>
  4314. Date: 5 Aug 85 17:46:28 GMT
  4315. References: <2561@ut-sally.UUCP> <2579@ut-sally.UUCP> <2590@ut-sally.UUCP>
  4316. Reply-To: std-unix@ut-sally.UUCP
  4317. Organization: U. Texas CS Dept., Austin, Texas
  4318. Lines: 45
  4319. Approved: jsq@ut-sally.UUCP
  4320. Draft-9: 8.1
  4321.  
  4322. ----------------------------------------------------------------------
  4323.  
  4324. From: seismo!BBN-LABS-B.ARPA!dan
  4325. To: ut-sally!BBN-LABS-B.ARPA!std-unix
  4326. Subject: Re: Storage allocators
  4327. Date: 05 Aug 85 12:30:18 EDT (Mon)
  4328.  
  4329. Much as I like alloca() in theory, I have to agree with Doug Gwyn that it is
  4330. not always implementable--at least, if you are starting with the runtime
  4331. environment already designed.  Alloca() is a LANGUAGE feature, not a library
  4332. feature; it just happens that on many UNIX machines it is possible to add it to
  4333. the library and slip it past the compiler as long as you don't try to use it
  4334. too hard.  On many systems, if you do
  4335.  
  4336.     routine_with_args(arg1, arg2, arg3, ..., alloca(100), argN,...);
  4337.  
  4338. the alloca() will screw things up completely because the arguments before and
  4339. after it were pushed on the stack--that is, are SP-relative--and alloca() has
  4340. munged the SP.  Sufficiently complex expressions can also cause this problem.
  4341. Unless alloca() is known to the compiler it usually cannot be implemented
  4342. correctly.
  4343.  
  4344. However, I don't understand Doug's comment about it encouraging sloppy
  4345. programming practice.  Alloca() provides the programmer with the ability to
  4346. declare automatic variables whose size is determined at runtime rather than
  4347. compile time; thus the size can reflect the size of input data, which is GOOD
  4348. programming practice.  If the makers of UNIX had had alloca() when they did
  4349. execvp(), they would not have (a) relied on the existence of array[-1], or (b)
  4350. assumed that there would not be more than 200 values in the array (as different
  4351. versions of that library routine did).  I don't think anyone would argue that
  4352. the use of alloca here would have resulted in sloppier code!  The only
  4353. alternative, if you want to be a good programmer, is to use malloc(), which is
  4354. relatively slow and quite clumsy.  I have never subscribed to the point of view
  4355. that not having to explicitly allocate and free each variable is "sloppy
  4356. programming practice"; that's what auto vars are, after all.
  4357.  
  4358.     Dan Franklin
  4359.  
  4360. ------------------------------
  4361.  
  4362. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4363. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4364. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4365. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4366. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4367.  
  4368. Volume-Number: Volume 1, Number 49
  4369.  
  4370. From jsq  Tue Aug  6 10:26:19 1985
  4371. Path: ut-sally!jsq
  4372. From: jsq@ut-sally.UUCP (John Quarterman)
  4373. Newsgroups: mod.std.unix
  4374. Subject: Re: standardized error messages
  4375. Message-Id: <2597@ut-sally.UUCP>
  4376. Date: 6 Aug 85 15:26:12 GMT
  4377. References: <2391@ut-sally.UUCP> <2461@ut-sally.UUCP> <2474@ut-sally.UUCP> <2560@ut-sally.UUCP>
  4378. Reply-To: std-unix@ut-sally.UUCP
  4379. Organization: U. Texas CS Dept., Austin, Texas
  4380. Lines: 41
  4381. Approved: jsq@ut-sally.UUCP
  4382. Draft-9: 2.5
  4383.  
  4384. ----------------------------------------------------------------------
  4385.  
  4386. From: Steve Glaser <steveg%hammer.TEK%tektronix.csnet@csnet-relay.arpa>
  4387. To: tektronix!ut-sally!std-unix@tektronix.CSNET,
  4388.         tektronix!std-unix%ut-sally.arpa@tektronix.CSNET
  4389. Date: Mon, 5 Aug 85 17:58:33 PDT
  4390. Subject: Re: standardized error messages
  4391.  
  4392. in Chris Torek's error example, please change:
  4393.  
  4394. >    if (e > 0) {
  4395. >        p = e < sys_nerr ? sys_errlist[e] : "unknown error";
  4396. >        (void) fprintf(stderr, ": %s", p);
  4397. >    }
  4398.  
  4399. to:
  4400.  
  4401. >    if (e > 0) {
  4402. >        if (e < sys_nerr)
  4403. >            (void) fprintf(stderr, ": %s", sys_errlist[e]);
  4404. >        else
  4405. >            (void) fprintf(stderr, ": unknown error number %d", e);
  4406. >    }
  4407.  
  4408. It's most annoying when an error message printing routine throws away
  4409. information.  Especially when you have new error codes cropping up and
  4410. programs that don't get recompiled (or at least relinked).
  4411.  
  4412. At least Chris checked against sys_nerr.  I've seen may programs that
  4413. don't bother and end up printing gibberish when a new error comes along.
  4414.  
  4415.     Steve Glaser
  4416.     tektronix!steveg
  4417.  
  4418. ------------------------------
  4419.  
  4420. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4421. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4422. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4423. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4424. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4425.  
  4426. Volume-Number: Volume 1, Number 50
  4427.  
  4428. From jsq  Tue Aug  6 17:41:15 1985
  4429. Path: ut-sally!jsq
  4430. From: jsq@ut-sally.UUCP (John Quarterman)
  4431. Newsgroups: mod.std.unix
  4432. Subject: Re: standardized error messages
  4433. Message-Id: <2607@ut-sally.UUCP>
  4434. Date: 6 Aug 85 22:41:02 GMT
  4435. References: <2391@ut-sally.UUCP> <2461@ut-sally.UUCP> <2474@ut-sally.UUCP> <2560@ut-sally.UUCP> <2597@ut-sally.UUCP>
  4436. Reply-To: std-unix@ut-sally.UUCP
  4437. Organization: U. Texas CS Dept., Austin, Texas
  4438. Lines: 104
  4439. Approved: jsq@ut-sally.UUCP
  4440. Summary: UNIX as TOPS-20
  4441. Draft-9: 2.5
  4442.  
  4443. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  4444. Topic: standardized error messages
  4445.  
  4446. The idea proposed in this message has been proposed before in this newsgroup.
  4447. I am letting it through anyway, since this is a more complete description
  4448. of the idea.  After the flurry of rebuttals which will no doubt ensue,
  4449. I would prefer we not rehash it yet a third time.
  4450.  
  4451. If the discussion devolves into a TOPS-20 vs. UNIX flaming match, I will
  4452. at some point (soon) arbitrarily cut it off.
  4453.  
  4454. ----------------------------------------------------------------------
  4455.  
  4456. Date: Fri, 5 Jul 85 12:25:33 est
  4457. From: Stephen Uitti <seismo!pur-ee!pucc-h!ach>
  4458. Subject: Re: standardized error messages
  4459. To: ecn.ARPA!cbosgd!seismo!ut-sally!std-unix
  4460.  
  4461. >From: Douglas Spencer <seismo!mcvax!daisy!maugg>
  4462. >> some commands take arguments as
  4463. >> command -abcdefg filename
  4464. >> and some as
  4465. >> command -a -b -c -d -e -f -g filename
  4466. >> It would be great if this was standardised.
  4467.     The result being getopt, based on these rules:
  4468. >   - Command names must be between 2 and 9 characters ("kermit" is 6).
  4469. >   - Command names must include lower case letters and digits only.
  4470. >   - An option name is a single character.
  4471. >   - Options are delimited by '-'.
  4472. >   - Options with  no  arguments  may  be  grouped  (bundled)  behind  one
  4473. >     delimiter.
  4474. >   - Option-arguments cannot be optional.
  4475. >   - Arguments immediately follow options, separated by whitespace.
  4476. >   - The order of options does not matter.
  4477. >   - '-' preceded and followed by whitespace means standard input.
  4478. >A group of bundled options may end with an option that has an argument.
  4479.     I prefer to make a forward sighted change, rather than a backwords
  4480. compatibility of the problem.  Going from no standard to a bad one is
  4481. no gain.  At least with no standard, people had the option of doing it
  4482. "right".  Once a standard is invented, it can't really be changed:
  4483. the only recourse is to reinvent a new universe.  Rules I use for
  4484. new programs are:
  4485. 1)     Command names must be real words or concatenations of words,
  4486.     max 9 characters (for V7 systems, for now).  They must not be
  4487.     one letter.  They should be more than 4.  Abreviations for
  4488.     parts of the command are acceptible, such as "mk" for "make" and
  4489.     "ck" for "check".  Especially if a real word can be used - "mkdepend".
  4490.     Suffixes are better - "filesysck" (might be a better name for "fsck").
  4491.     Siffixes allow the same abbreviation, but allow someone to write a
  4492.     command-completion or least-ambiguous command recognition shell.
  4493. 2)     Command names should be lower case.
  4494. 3)     Option names are real words.  Single letters are too difficult
  4495.     to remember.  They are to be parsed in a least ambiguous fashion.
  4496. 4)     "-help" IS an option.  This gives a usage message and a one-line
  4497.     description of each option.  The manual page should be nearly
  4498.     superflous.  In interactive mode "?" gives a quick list of command
  4499.     names.
  4500. 5)     Options start with a "-", on the command line.
  4501. 6)     Options with arguments are of the form -foo=bar,foobar.
  4502. 7)     Options do not get bundled together.  This is bogus.
  4503. 8)     Option-argumets are optional.  The default is useful.
  4504. 9)     If no options are given, something reasonable will happen.  If
  4505.     nothing reasonable can be done, a usage message will be printed.
  4506. 10)    Having an interactive mode is not an unreasonable thing for a
  4507.     program to have.  The interactive mode HAS a prompt (which may
  4508.     be turned off/changed).
  4509. 11)    Non-options are usually file names.
  4510. 12)    Options and file names may be interspersed.  The order of options
  4511.     often matters.  If this is the case, left to right parsing is used.
  4512.     So, if two options (such as -optimize and -nooptimize) conflict,
  4513.     the rightmost will be used.  Note that "pascal -opt file2 -noopt
  4514.     file3" will optimize file2, but not file3.
  4515.  
  4516.     To this end, I have written a least ambiguous command parser
  4517. subroutine library which can be used from the command line and/or
  4518. interactively.  It works well.  I like to have billions of options
  4519. in my programs, but can never remember them.  Some of them are seldom
  4520. used.  Often, new options are added.  Shell scripts won't break if they
  4521. always used the whole option name.  Shell scripts are more readable if
  4522. they use the whole option name.  Usually one need only type one
  4523. or two letters of an option name.
  4524.     There are some programs out there that do least ambiguous command
  4525. parsing:  "lpc", "ftp" and "kermit" are some.  There's a whole operating
  4526. system too: "twenex".
  4527.     The reason I vote for such change is that UNIX is no longer V6,
  4528. with 50 commands, each with 5 options.  It's now 400 commands, each with
  4529. 10 options.  V6 ran on an 11/40 that had a single RK05 (2.5 Megabytes),
  4530. full sources, with 300+ blocks left for the user (150 K bytes of disk).
  4531. RK05's are now little bigger than floppys (and little faster).  Now
  4532. if you only have 100 Meg devoted to /usr, you might not be able to have
  4533. quite everything on it.  News or sources might have to be put elsewhere.
  4534. Certainly your users will be elsewhere.
  4535.     The systems are bigger, and harder to maintain.  That's progress.
  4536.     Steve Uitti, PUCC, ...pur-ee!pucc-h!ach (ach@purdue-asc.ARPA).
  4537.  
  4538. (The opions expressed...)
  4539.  
  4540. ------------------------------
  4541.  
  4542. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4543. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4544. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4545. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4546. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4547.  
  4548. Volume-Number: Volume 1, Number 51
  4549.  
  4550. From jsq  Tue Aug  6 17:45:21 1985
  4551. Path: ut-sally!jsq
  4552. From: jsq@ut-sally.UUCP (John Quarterman)
  4553. Newsgroups: mod.std.unix
  4554. Subject: Re: Storage allocators
  4555. Message-Id: <2608@ut-sally.UUCP>
  4556. Date: 6 Aug 85 22:45:14 GMT
  4557. References: <2561@ut-sally.UUCP> <2579@ut-sally.UUCP> <2590@ut-sally.UUCP> <2592@ut-sally.UUCP>
  4558. Reply-To: std-unix@ut-sally.UUCP
  4559. Organization: U. Texas CS Dept., Austin, Texas
  4560. Lines: 37
  4561. Approved: jsq@ut-sally.UUCP
  4562. Draft-9: 8.1
  4563.  
  4564. ----------------------------------------------------------------------
  4565.  
  4566. Date: Tue, 6 Aug 85 01:11:53 PDT
  4567. From: seismo!sun!guy (Guy Harris)
  4568. To: cbosgd!std-c, ut-sally!std-unix
  4569. Subject: Re: Storage allocators
  4570.  
  4571. > Unix has long had an undocumented routine alloca(), which allocates
  4572. > storage off the stack.  This storage then goes away when the function
  4573. > returns.
  4574.  
  4575. *Some* UNIXes have had it.  It was a PWB/UNIX invention, and wiggled its way
  4576. into 4.xBSD; I don't remember it being in V7.
  4577.  
  4578. > ...since C supports variables on the stack, so I doubt that there are many
  4579. > machines which can't do alloca(), and for Unix, it comes down to
  4580. > documenting something that has been there for a long time.
  4581.  
  4582. If you said "I know that there are no machines which can't do 'alloca'", I'd
  4583. be more in favor of this proposal.  C supports variables on the stack, but
  4584. that merely requires that you can allocate a stack frame on procedure entry,
  4585. not that you can extend a stack frame during the execution of a procedure.
  4586. I would not be willing to say that all machines with C implementations can
  4587. do that.
  4588.  
  4589. >From the standpoint of UNIX, it's not clear that it's something that's been
  4590. there for a long time in *all* UNIXes.
  4591.  
  4592.     Guy Harris
  4593.  
  4594. ------------------------------
  4595.  
  4596. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4597. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4598. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4599. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4600. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4601.  
  4602. Volume-Number: Volume 1, Number 52
  4603.  
  4604. From jsq  Sat Aug 10 17:16:43 1985
  4605. Path: ut-sally!jsq
  4606. From: jsq@ut-sally.UUCP (John Quarterman)
  4607. Newsgroups: mod.std.unix
  4608. Subject: Re: Storage allocators
  4609. Message-Id: <2642@ut-sally.UUCP>
  4610. Date: 10 Aug 85 22:16:36 GMT
  4611. References: <2561@ut-sally.UUCP> <2579@ut-sally.UUCP> <2590@ut-sally.UUCP> <2592@ut-sally.UUCP> <2608@ut-sally.UUCP>
  4612. Reply-To: std-unix@ut-sally.UUCP
  4613. Organization: U. Texas CS Dept., Austin, Texas
  4614. Lines: 96
  4615. Approved: jsq@ut-sally.UUCP
  4616. Draft-9: 8.1
  4617.  
  4618. From: John Quarterman (moderator) <std-unix-request@ut-sally>
  4619. Topic: Storage allocaters (alloca)
  4620.  
  4621. ----------------------------------------------------------------------
  4622.  
  4623. From: ihnp4!hcr!hcrvx1!hugh
  4624. Date: 8 Aug 85 11:37:25 CDT (Thu)
  4625. To: hcr!ihnp4!ut-sally!std-unix
  4626. Subject: Re: Storage allocators
  4627.  
  4628. > ...since C supports variables on the stack, so I doubt that there are many
  4629. > machines which can't do alloca(), and for Unix, it comes down to
  4630. > documenting something that has been there for a long time.
  4631.  
  4632. alloca(), when implemented behind the back of a compiler is dangerous,
  4633. as described earlier ("f(..., alloca(...), ...)").  It also has a
  4634. potential performance penalty on EVERY function, not just those that use
  4635. it: with alloca, the system is forced to have a distinct frame pointer
  4636. and stack pointer.  Without the possibility of alloca, a frame pointer
  4637. is not needed (the activation record can be accessed by
  4638. known-at-compile-time offsets from the stack pointer).  Using two
  4639. registers instead of one could cause a noticeable increase in function
  4640. prologue/epilogue time.
  4641.  
  4642. I agree that the functionality of alloca() is useful, but it is not
  4643. sanely handled as a library routine.  ALGOL-60 got this right;
  4644. too bad its descendants didn't.
  4645.  
  4646. It appears that the C standard will give the compiler license to "know"
  4647. about library routines specified in the standard (and no others!).  Thus
  4648. the compiler would be able to treat alloca specially if it were included
  4649. in the standard.  Such a compiler might need an extra pass to be able to
  4650. avoid using a frame-pointer, and it would have to be able to generate
  4651. code both with and without a frame-pointer.  Even generating correct code
  4652. is tricky.  Perhaps, if alloca is standardized, it should be restricted
  4653. to certain usages, just as setjmp has been.
  4654.  
  4655. My hope is that alloca could be eliminated.  But even though it is
  4656. undocumented, there may be too many programs using it now.  Does anyone
  4657. know?
  4658.  
  4659. Perhaps this discussion should be in mod.std.c, not mod.std.unix.  I
  4660. hope that I have convinced you that this is a compiler/language issue,
  4661. not an isolated library issue.
  4662.  
  4663. [ The article that started the discussion was cross-posted to the two
  4664. newsgroups.  It's not clear that it still belongs in mod.std.unix,
  4665. but since it's involved UNIX history and implementation, I've seen
  4666. no reason to discourage it.  C library issues in general do more 
  4667. properly belong in mod.std.c, though.  -mod ]
  4668.  
  4669. ------------------------------
  4670.  
  4671. From: ihnp4!tektronix!hammer.TEK!steveh (Stephen Hemminger)
  4672. To: tektronix!ihnp4!seismo!ut-sally!jsq
  4673. Date: Fri, 9 Aug 85 09:14:33 PDT
  4674. Subject: Re: Storage allocators
  4675. In-Reply-To: <2592@ut-sally.UUCP>
  4676. References: <2561@ut-sally.UUCP> <2579@ut-sally.UUCP> <2590@ut-sally.UUCP>
  4677.  
  4678. On the Tek NS32000 computers we have to fudge to get alloca() to work, but
  4679. I think the same technique might work on other computers.
  4680.  
  4681. The stack frame looks like:
  4682.     sp ->  ...
  4683.           saved registers (0 ... 8)
  4684.           local vars
  4685.     fp -> old fp
  4686.           args
  4687.  
  4688. The kludge we implemented for alloca was to allocate 32 bytes (8 regs)
  4689. more of storage and copy the top 32 bytes.  Unless the machine has
  4690. a huge number of registers, this technique should allow alloca on
  4691. any machine!
  4692.  
  4693.                 |--|        |--|
  4694.   [I'd rather be skiing]    | /|        | /|
  4695.                 .    |/ |        |/ |
  4696.                    .|--|        |--|
  4697.                 | .|        |  |
  4698.     Stephen Hemminger    |  |.        |  |
  4699.     (steveh@hammer.TEK)        .
  4700.                    .
  4701.                  .
  4702.                     .
  4703.  
  4704. [ I've broken my rule of asking for explicit permission to post things
  4705. mailed to my personal address, since this one was an obvious submission. -mod ]
  4706.  
  4707. ------------------------------
  4708.  
  4709. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4710. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4711. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4712. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4713. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4714.  
  4715. Volume-Number: Volume 1, Number 53
  4716.  
  4717. From jsq  Wed Aug 14 14:18:00 1985
  4718. Path: ut-sally!jsq
  4719. From: jsq@ut-sally.UUCP (John Quarterman)
  4720. Newsgroups: mod.std.unix
  4721. Subject: Re: standardized error messages
  4722. Message-Id: <2681@ut-sally.UUCP>
  4723. Date: 14 Aug 85 19:06:53 GMT
  4724. References: <2391@ut-sally.UUCP> <2461@ut-sally.UUCP> <2474@ut-sally.UUCP> <2560@ut-sally.UUCP> <2597@ut-sally.UUCP> <2607@ut-sally.UUCP>
  4725. Reply-To: std-unix@ut-sally.UUCP
  4726. Organization: U. Texas CS Dept., Austin, Texas
  4727. Lines: 45
  4728. Approved: jsq@ut-sally.UUCP
  4729. Draft-9: 1003.2.getopt 2.5
  4730.  
  4731. ----------------------------------------------------------------------
  4732.  
  4733. Date: Sun, 11 Aug 85 23:20:34 edt
  4734. From: Ian! D. Allen <ihnp4!watmath!idallen>
  4735. To: ut-sally!std-unix
  4736. Subject: On interspersing options in command lines.
  4737.  
  4738. At Waterloo, we've used full-word options on our Honeywell/GCOS system
  4739. for years.  Gosh it makes reading the "man" pages easier!  We're bringing
  4740. an automated full-word-options parser to our UNIX systems now, and our
  4741. parser will have the "+help" self-documentation feature.  (At Waterloo
  4742. we use "+" and "-" for ON and OFF, rather than '-opt' and '-noopt'.)
  4743.  
  4744. Consider how the following syntax might be interpreted:
  4745.  
  4746.    $ commandname +optimize file1 -optimize file2 file3
  4747.  
  4748. 1) Options are only recognized at the beginning of a command line.
  4749.    - file1 is optimized; file named '-optimize' is not found
  4750. 2) Options are recognized where they are found, and apply to all
  4751.    following objects.
  4752.    - file1 is optimized; file2 and file3 are not optimized
  4753. 3) Options apply to the entire command line, no matter where they are found.
  4754.    - option '+optimize' conflicts with '-optimize' and nothing is done
  4755.  
  4756. Waterloo is currently using the Type 3 interpretation.  If options
  4757. apply to the entire command line, no matter where they are typed, I can
  4758. enter the words on my command lines in the order I think of them.  I
  4759. find the most common way I enter command lines is to type in all the
  4760. file names first, then follow them with the modifying options I want.
  4761. In the rare (very rare) cases where I want to apply the same command
  4762. with different options to some files, I use separate command lines.
  4763.  
  4764. I claim that the convenience of letting users type in the words in the
  4765. order they want more than compensates for the resulting need to use
  4766. multiple commands every now and then.  (I'd love to have some survey data
  4767. to back this claim up.)
  4768.  
  4769. ------------------------------
  4770.  
  4771. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4772. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4773. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4774. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4775. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4776.  
  4777. Volume-Number: Volume 1, Number 54
  4778.  
  4779. From jsq  Wed Aug 14 14:26:52 1985
  4780. Path: ut-sally!jsq
  4781. From: jsq@ut-sally.UUCP (John Quarterman)
  4782. Newsgroups: mod.std.unix
  4783. Subject: Re: Storage allocators
  4784. Message-Id: <2682@ut-sally.UUCP>
  4785. Date: 14 Aug 85 19:15:38 GMT
  4786. References: <2561@ut-sally.UUCP> <2579@ut-sally.UUCP> <2590@ut-sally.UUCP> <2592@ut-sally.UUCP> <2608@ut-sally.UUCP> <2642@ut-sally.UUCP>
  4787. Reply-To: std-unix@ut-sally.UUCP
  4788. Organization: U. Texas CS Dept., Austin, Texas
  4789. Lines: 31
  4790. Approved: jsq@ut-sally.UUCP
  4791. Draft-9: 8.1
  4792.  
  4793. ----------------------------------------------------------------------
  4794.  
  4795. Date: Tue, 13 Aug 85 11:38:32 edt
  4796. From: seismo!allegra!phri!roy (Roy Smith)
  4797. To: ut-sally!std-unix
  4798. Subject: Storage allocation
  4799. Cc: roy
  4800.  
  4801.     I'm not sure if it is really germane to the issue at hand, but I
  4802. recently (yesterday) submitted to mod.sources a little package to handle
  4803. run time memory allocation for multi-dimensional arrays.  You might want to
  4804. take a look at it.
  4805.  
  4806.     Is it reasonable to include such a functionality in a Unix
  4807. standard?  I don't know if memory allocators should be considered part of
  4808. the C language, or part of the Unix OS, but given the fuss that went on
  4809. recently (in net.unix-wizards?) about the issue, it seems that it should be
  4810. addressed somewhere.  Of course, my implementation isn't necessarily the
  4811. best one (or even a good one), but I think the idea is sound.
  4812.  
  4813. Roy Smith <allegra!phri!roy>
  4814. System Administrator, Public Health Research Institute
  4815. 455 First Avenue, New York, NY 10016
  4816.  
  4817. ------------------------------
  4818.  
  4819. Discussions-Of: UNIX standards, particularly the IEEE P1003 draft standard.
  4820. Submissions-To:    ut-sally!std-unix    or std-unix@ut-sally.ARPA
  4821. Comments-To: ut-sally!std-unix-request    or std-unix-request@ut-sally.ARPA
  4822. UUCP-Routes: {ihnp4,seismo,harvard,gatech}!ut-sally!std-unix
  4823. Archives-In: ~ftp/pub/mod.std.unix on ut-sally.ARPA (soon sally.UTEXAS.EDU)
  4824.  
  4825. Volume-Number: Volume 1, Number 55
  4826.  
  4827.