Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 12/4/83; site rlgvax.UUCP Path: utzoo!watmath!clyde!floyd!harpo!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: awk Message-ID: <1794@rlgvax.UUCP> Date: Fri, 9-Mar-84 18:37:28 EST Article-I.D.: rlgvax.1794 Posted: Fri Mar 9 18:37:28 1984 Date-Received: Sat, 10-Mar-84 12:49:38 EST References: <2647@alice.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 43 It's nice that the current "awk" manual documents the behavior of output redirection. *Why didn't the original "awk" manual do this?* It's sufficiently counter- intuitive (if you're used to the behavior of output redirection in the shell) that it shouldn't have gone unmentioned (note the amount of discussion it has generated, if you don't think it needed to be documented). I have yet to see a Bell UNIX release which didn't have at least one significant thing totally undocumented (did you know that the TCXONC "ioctl" in USG UNIX - S3, S5, etc. - permits you to suspend and restart *input* as well as output? The "arg" values for that are 3 and 4, and it's present in S3 and S5 and documented in *neither*) - Berkeley documented the "varargs" include file (provides a mostly-portable way to write routines which take a variable number of arguments; 1000 thanks due to Mark Horton for documenting it), but I think there are probably undocumented goodies there too. Speaking of "varargs", there is an undocumented version of the "*printf" family in S3 - although not in S5 - which provides the functionality of calling "_doprnt" directly. Very nice if you want a version of "curses" that works on systems without "_doprnt".... The routines are "vprintf", "vfprintf", and "vsprintf", and they take the same first couple of arguments as their non "vararg" counterparts, except that they get passed a pointer to the argument list instead of getting passed the arguments directly. Also, in all V7 and post-V7 versions of "login" I've seen, the user's login shell is executed by "execlp", so you can have a shell file as a login shell. We have actually *used* this feature, and it came in handy (we wanted to have somebody come into a non-standard shell and have the TZ environment variable set - this is a misfeature of USG UNIX; you can't use non-standard login shells unless 1) they know how to set the timezone stuff up, 2) you recompile "ctime" to default to your timezone and relink *everything* that is run by that shell, 3) you put in a system call to get the time zone (like the V7 "ftime" or 4.2BSD "gettimeofday" system calls) and have "ctime" get the default time zone from that, or 4) you are in the Eastern Standard Time zone). Is it just that the person who put in those features never told anybody and left before they had a chance, and nobody else noticed it and told the documentation people? (Hell, if the documentation were better, I suspect the traffic in "net.unix" and "net.unix-wizards" would drop quite a bit!) Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy