Unix-Wizards-Request@arpa.brl (Mike Muuss) (06/24/88)
UNIX-WIZARDS Digest Fri, 24 Jun 1988 V5#078 Today's Topics: touch (Was Re: -since option for ls -lt) Re: lp/lpr interface Re: Question about value of a source licence "dd conv=unblock cbs=80" Re: Curses & Color Re: "Open" Software Foundation: GNU Re: -since option for ls -lt Re: whence ``glob'' ZIM vs PROGRESS Re: implementing pseudo-asynchronous io on SYS5 Re: sh(1) command substitution and here documents Re: touch (Was Re: -since option for ls -lt) Re: What do panic messages mean? ----------------------------------------------------------------- From: Geoff Rimmer <maujd@warwick.uucp> Subject: touch (Was Re: -since option for ls -lt) Date: 21 Jun 88 13:37:06 GMT Sender: news@warwick.uucp To: unix-wizards@brl-sem.arpa In article <344@ajpo.sei.cmu.edu> jrkelly@ajpo.sei.cmu.edu (John Kelly) writes: > >Has anyone implemented any of the following for Unix: > > 1. a directory listing command with a -since option? > 2. a program to force a specified modification time upon a specified file? > 3. a program to compare two dates/times and return an appropriate status? > >where the dates/times are given in string form, as in the output of "date" and >"ls"? Although I haven't done #1, I would have thought it would be a fairly easy C routine to write. Use readdir(3) to step thru the files, and stat(2) to find the modify time - then only print the info if the file is after the time/date specified by -since. #2 is already implemented on our (system V version) touch(1V) :- ---------------------------------------------------------------------- NAME touch - update times of last access and modification of a file SYSTEM V SYNOPSIS touch [ -c ] [ -a ] [ -m ] [ mmddhhmm[yy] ] filename ... DESCRIPTION touch causes the access and modification times of each argu- ment to be set to the current time. A file is created if it does not already exist. OPTIONS -c Do not create filename if it does not exist. -a Update only the access time. -m Update only the modification time. mmddhhmm[yy] Update the times to the specified time rather than to the current time. The first mm is the month, dd is the day of the month, hh is the hour, and the second mm is the minute; if yy is specified, it is the last two digits of the year, otherwise the current year is used. ---------------------------------------------------------------------- Don't know about #3. Geoff ------------------------------------------------------------ Geoff Rimmer, Computer Science, Warwick University, UK. maujd@uk.ac.warwick.opal "Oh, don't be so sentimental mother, things explode every day." ------------------------------------------------------------ ----------------------------- From: Andrew Beattie <andrew@riddle.uucp> Subject: Re: lp/lpr interface Date: 20 Jun 88 08:07:57 GMT To: unix-wizards@brl-sem.arpa In article <16162@brl-adm.ARPA> drl%backup@uunet.uu.net (David R. Linn) writes: >Before I reinvent the wheel, can anyone provide pointers on interfacing >lpr- and lp-based spooling? I have a network with both SUNOS/BSD machines >and HP-UX/SYSV machines and would like to be able to print from any machine >to any printer; This is the script that I use to set up the printers here. It goes round all our computers and sets up all the spoolers so that anyone can print on any printer from anywhere (good eh?) Some notes: This copy has had some site specific stuff hacked out of it (our interface scripts are actualy split into several parts and need special handling) and so has't been tested in exactly this form. The directory that the script is run from should contain the printer interface models. (in our case these are called draft and laser) In order to cope with different printer speeds, the interfaces should contain SPEED=set_this_at_installation stty $SPEED ........etc I havn't got shar to hand so convert this to a shell script simply by removing the X at the begining of each line and cutting at the CUT HERE line To configure for your network, you will need to change the value of ALLMACHINES to all the sysV machines on your net and the table at the top of the script to indicate which printers are on which machine. I have not included the draft and laser interface script, but I have included the network transfer script. This script must also be in the same directory and named tcp. We have only one BSD machine and I interface it by having a script called *lp* which does: su guest_account -c "remsh sys_V_server_machine lp $*" Script starts here: --------------------------------------------------------------------------- X# ALL MACHINES NOT TO INCLUDE BSD MACHINES XALLMACHINES="amachine bmachine cmachine dmachine emachine fmachine" Xtmpconf=/tmp/prconf$$ Xcat >$tmpconf <<! X1printer amachine tty1a laser 4800 X2printer bmachine tty8d laser 9600 X3printer cmachine tty15 draft X4printer dmachine tty8b draft X5printer emachine tty8c laser 9600 X6printer fmachine tty43 laser 19200 X7printer gmachine tty9f laser 9600 X! X Xfor target in $ALLMACHINES Xdo X echo purging spooler on ${target} X remsh ${target} /usr/lib/lpshut X remsh ${target} lpstat -o "|" cut "-d\ " -f1 "|" sed 's/\^/cancel\ /' \ X">" /tmp/clearup$$ X for printer in `remsh ${target} lpstat -a |cut "-d " -f1` X do X # remsh ${target} /usr/lib/lpadmin -x${printer} X remsh ${target} rm -rf /usr/spool/lp/interface/${printer} \ X/usr/spool/lp/member/${printer} /usr/spool/lp/request/${printer} X done X remsh ${target} cat /dev/null ">" default X remsh ${target} cat /dev/null ">" pstatus X remsh ${target} cat /dev/null ">" log X remsh ${target} cat /dev/null ">" qstatus X remsh ${target} cat /dev/null ">" seqfile X remsh ${target} cat /dev/null ">" outputq X X for printer in `cut -f1 $tmpconf` X do X echo creating the printer ${printer} on ${target} X set -- `grep "^$printer " $tmpconf` X remsh $target chmod 600 /dev/$3 X remsh $target chown lp /dev/$3 X model=$4 X if [ $2 != $target ] X then X sed "s/^SERVER=.*/SERVER=$2/" <tcp >/tmp/tcp$$ X rcp /tmp/tcp$$ ${target}:/usr/spool/lp/model/temp X remsh ${target} /usr/lib/lpadmin -p$printer \ X-v/dev/null -mtemp X else X rcp $model ${target}:/usr/spool/lp/model/temp X remsh ${target} /usr/lib/lpadmin -p$printer \ X-v/dev/$3 -mtemp X fi X remsh ${target} enable ${printer} X remsh ${target} /usr/lib/accept ${printer} X done X # remsh ${target} /usr/lib/lpsched "<" /dev/null Xdone X ----------- CUT HERE --------------- X# this script is called tcp XERR="lp remote print spooler failure: contact administrator" XSERVER=support # Name of target machine X XPRINTER=`basename $0` XBANNER="${3:-$2}" XCOPIES=$4 Xfor I in $5 Xdo X OPTIONS="$OPTIONS -o$I" Xdone Xshift; shift; shift; shift; shift Xfor I Xdo X if echo $I | grep "/usr/spool/lp" > /dev/null 2>&1 X then X chmod a+r $I X while : X do X # this should use rcp ... but never mind X if cat $I | remsh ${SERVER} lp -d$PRINTER \ X"-t$BANNER" "-n$COPIES" "$OPTIONS" - X then X exit 0 X else X sleep 60 X fi X done X X X X fi Xdone Andrew Beattie Sphinx, 43-53 Moorbrige Road, Maidenhead, England mcvax!ukc!reading!riddle!andrew andrew@sphinx.co.uk +44 628 75343 #include <disclaimer.h> ----------------------------- From: Geoff Kratz <kratz@dataspan.uucp> Subject: Re: Question about value of a source licence Date: 21 Jun 88 14:09:30 GMT Keywords: source licence, suns, money To: unix-wizards@SEM.BRL.MIL In article <2439@quacky.mips.COM>, dce@mips.COM (David Elliott) writes: > You really haven't provided a lot of background. ... > David Elliott dce@mips.com or {ames,prls,pyramid,decwrl}!mips!dce Sorry, you're right. Our department (R&D) is primarily concerned with developing new software systems. We are currently working on a system to scan a document (maps at the moment) using a high-res scanner (Scitex laser scanner) and creating a boundary chain from the raster file. We then extract the medial axis from this file to produce the vector file. This is processed by people to add contour information (elevation and feature codes) plus any other useful info (this is the data capture departments area). The resulting file is converted to any number of formats (IGES, SIF) for a client. Included in this are a raster editor to clean the raster file and extract the parts we need, and a vector editor to manipulate the vector files. Our main goal for getting the source is to gain some insight into the system itself (the documentation enhancement you mentioned). For me specifically, that means actually see what happens in the low-level windowing (the documentation seems to be sparse or missing in places). A secondary goal is to make things easier for system admin internally (my other job around here). Our user-base (half technical, half non-technical) always wants to know "why it isn't working" when things break, and our manager is not always happy with vague answers to wierd problems. Pointing to a line of code (even though he doesn't know what it means) and saying "there!" would make things simpler for me and show them that I could (maybe) fix it, but shouldn't because that would mean re-fixing each release until Sun fixed it themselves (you also mentioned this regarding system hacks). The source isn't all that crucial for this aspect, but it sure would help. But, as I said before, our management would like to see some "revenue" created directly because of the licence (you know, money for money) and our department's arguments alone aren't sufficient. -- Geoff Kratz Dataspan Technology Inc. Ph:(403) 237-9313 400-540 5th Av SW Calgary Alberta Canada T2P 0M2 "Hey, no problem!" ...!{ubc-vision,mnetor}!alberta!calgary!dataspan!kratz ----------------------------- From: Andrew Klossner <andrew@frip.gwd.tek.com> Subject: "dd conv=unblock cbs=80" Date: 22 Jun 88 16:01:50 GMT Sender: andrew@tekecs.tek.com To: unix-wizards@brl-sem.arpa >> Can't you just do: "dd conv=unblock cbs=80 (or whatever)" to >> convert the file to standard Unix \n-terminated lines? Hasn't this been >> part of Unix since at least v6? > Apparently not: neither System III nor System V r3.1 supports it. (I used > "strings" on both systems, to make sure it wasn't merely undocumented). Either your "strings" is busted or you have a crippled V3.1. The vanilla AT&T 3.1 source tape includes a dd.c that implements this command. -=- Andrew Klossner (decvax!tektronix!tekecs!andrew) [UUCP] (andrew%tekecs.tek.com@relay.cs.net) [ARPA] ----------------------------- From: "Mike H. Moran" <mhm@cbterra.att.com> Subject: Re: Curses & Color Date: 23 Jun 88 12:46:08 GMT To: unix-wizards@SEM.BRL.MIL Color may be supported, but not correctly in the background. The release notes for SVR3.1 say the attributes operating on the background are unreliable. A fact I have found to be quite true on the 6386. Mike Moran Contracted to AT&T-BL, Columbus, Oh UUCP: att!cbosgd!mhm ----------------------------- From: Jim Adcock <jima@hplsla.hp.com> Subject: Re: "Open" Software Foundation: GNU Date: 22 Jun 88 18:50:22 GMT To: unix-wizards@SEM.BRL.MIL | Is the gcc licence agreement more restrictive than commercial (say AT&T | for example) compiler licences. On my system all the include files | have AT&T Copyright notices on them. My (binary only) licence doesn't | say anything about exemptions for libraries or include files. Arguably | giving/selling a program compiled on my system is redistributing stuff | that my licence forbids. It would have major ramifications for the | whole industry if anyone tried to enforce such an interpretation. In general, I believe the FSF license is about as restrictive as other commercial software [note -- I consider FSF software to be commercial software] While I am not a lawyer, and the following should not be considered any kind of legal advice, it seems that the general consensus is that selling or distributing software in binary form that contains any binary code that directly or indirectly comes from someone else's source code IS a violation of that person's/company's copyright on the original source. The exception would be binaries resulting from sources that are in the public domain [FSF sources are NOT public domain] If using someone's include file does not cause code to be generated directly related to that include file -- as in the case where an include file only includes definitions, and no source corresponding to executable code, then presumably one could use the include file in the compile process to help generate your binaries. In general, one is not free to sell or distribute binaries that include binary code linked in from libraries generated from someone else's source code, unless one has specifically purchased additional licenses allowing one to do so from the people who originally wrote those libraries. Since these additional licenses typically cost thousands of dollars, presumably you know if you have purchased such licenses. Otherwise you shouldn't be redistributing binaries that include code from these libraries. This would be no different than any other form of unauthorized copying and redistributing software without the proper license [commonly known as software piracy] In general, when you purchase a compiler with libraries, you are only allowed to use software generated using that compiler, which includes code from those libraries, for your own personal use on that one particular machine. Any selling or redistribution of the resulting binaries requires the purchasing of these additional "commercial use" licenses. Also, please be aware that even if you don't explicetly call for linking someone else's libraries in with your code, most compilers will still include binary code derived from that compiler manufacturer's source code in your binaries -- so you still have to get the additional commercial licenses. Examples of this include the _main() wrapper which is placed around your main() routine, built-in new or delete or memory management features, built-in support for floating point routines, etc. I do not pretend to know what common industry practice is in these regards. I suspect that many people DO distribute or sell software that contains binaries from libraries that they do not have these additional "commercial" licenses for. Whether or not one agrees that this is the way software copyrights should work [I don't,] why would one live one's life outside of the legal framework? Especially, why would one run a company or a consulting business outside of a legal framework? Is this not plain, simple theft? I do know that on the commercial projects I have worked on, my managers have consistently worked VERY carefully and diligently to make sure we always clear, clean, legal title to ALL, every last bit of binary code that goes into our software products. To do so is frankly a royal pain in the b*tt, and keeps us from using many otherwise good products. But we feel its necessary that when we are done, that no one could possibly come back and make some claim that they have some ownership over our efforts. Do you not wish to have clear ownership over the software products you develop??? Frankly, I hate and detest these restrictions on the use of compilers and libraries. Compilers and libraries are SUPPOSE to be used for generating runnable binary code. To me, for the manufacturers of these compilers and libraries to then turn around and claim ownership over part of the compiled code is tantamount to Stanley Tools claiming they own part of my house because I used a Stanley hammer to help build my house. But the Law seldom corresponds to MY concepts of common decency and common sense. The above represents this authors opinions only, expressed as a USER of compilers and libraries, and should not be considered a substitute for legal advice from someone competent in software law. Please consider the above to only be motivating statements to encourage you to do what's necessary to stay inside the law, and to seek legal advice as necessary. PS: I HATE LAWYERS TOO. [except when they save my *ss] ----------------------------- From: bob desinger <bd@hpsemc.hp.com> Subject: Re: -since option for ls -lt Date: 23 Jun 88 00:22:55 GMT To: unix-wizards@brl-sem.arpa Steve Summit (scs@athena.mit.edu) writes: > 2. There are (probably nonstandard) versions of test that can do > test file1 -nt file2 > test file1 -ot file2 > ("newer than" and "older than"). The Korn shell has this. `test' is a built-in command to ksh. ----------------------------- From: Dave Decot <decot@hpisod2.hp.com> Subject: Re: whence ``glob'' Date: 23 Jun 88 07:44:04 GMT To: unix-wizards@brl-sem.arpa Although I've heard the "delete with switches" story, I always was under the impression that "dsw" really stands for the Russian phrase meaning "goodbye". Dave "DUH Swee DUHNya?" Decot ----------------------------- From: Tom Betz <tbetz@dasys1.uucp> Subject: ZIM vs PROGRESS Date: 23 Jun 88 19:24:23 GMT Keywords: Zim, Progress, 4GL, RDBMS To: unix-wizards@SEM.BRL.MIL x In evaluating 4GL/RDBMS products available for Xenix 386, with an aim of using one of these to develop an order proccessing/inventory management/production database system, I've come down to a choice between Zim and Progress... and right now I'm leaning toward Zim, for several reasons: 1: Zim has a richer set of built-in mathematical functions, while retaining all the capabilities of Progress. 2: Zim's set- and entity-based approach (including ROLES, a sort of aliasing) appeals to my sense of how a business is actually structured. I do feel a bit of discomfort at letting go of arrays, since Zim does not employ them, but I also feel that the power offered by set handling will easily offset this. 3: Zim's self-documentation features far outstrip Progress's. One example - when one adds or deletes a field from a file, one needs must recompile any compiled procedures using that file. Zim is kind enough to tell you which procedures need to be recompiled, so you are less likely to miss one. This could save a lot of grief in an OLTP system! 4: Progress automatically compiles every procedure before running it, while Zim permits considerable debugging in an interpreter, then lets the user decide when it's time to compile. Zim even permits compiled procedures to call uncompiled procedures, and vice-versa! Zim's approach, while offering considerable power to the user, also leaves itself open to some hazards (if the interpreted procedure happens to return something the procedure calling it doesn't anticipate) but I think the power it offers is well worth the tradeoff. These are just a few of the points I have observed in a couple weeks' part-time exploration of these two packages. I would very much appreciate comments from anyone who has used either or both of these packages regarding points I may have missed or should look out for... also from partisans of other 4GL packages that can offer reasons why I'm missing the boat here. As usual, if sufficient response is generated, I will summarize to the Net. -- Tom Betz ZCNY {bellcore,cmcl2}!cucard!dasys1!tbetz Yonkers, NY, USA 10701-2509 "Opinions? What opinions? These are >facts<!!" ----------------------------- From: "William E. Davidsen Jr" <davidsen@steinmetz.ge.com> Subject: Re: implementing pseudo-asynchronous io on SYS5 Date: 23 Jun 88 15:06:27 GMT Keywords: OSI To: unix-wizards@brl-sem.arpa One way to do this is to fork processes and communicate via semiphores when data is available. The actual data may be passed via pipes, messages, or shared memory, depending on how confortable you are with these. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me ----------------------------- From: "William E. Davidsen Jr" <davidsen@steinmetz.ge.com> Subject: Re: sh(1) command substitution and here documents Date: 23 Jun 88 15:17:32 GMT To: unix-wizards@brl-sem.arpa In article <6774@sigi.Colorado.EDU> wu@spot.Colorado.EDU (WU SHI-KUEI) writes: | You don't need or want the here document. The following will do just fine: | | #!/bin/sh # not needed with REAL UNIX | var=`bc ' | scale = 2 | 3 / 4 | quit'` | | The 'quit' is essential since bc keeps reading the standard input after the command have been read. I think something got lost in typing this one... the first argument of bc is a filename, and bc just complains in both BSD and SysV (I tried several) versions. I have a solution, crude that it is: #!/bin/sh # insert error checking here temp=/tmp/bctmp$$ echo "scale=2; $1/$2; quit" > $temp bc $temp rm -f $temp That will return the first argument divided by the second. You can also just have the scale the first arg and the expression the second, which makes it a lot more general, where the echo statement becomes: echo "scale=$1; $2; quit" > $temp This is slow, clunky, and as far as I can tell portable to V7 and later. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me ----------------------------- From: Russell Kent <kent@tifsie.uucp> Subject: Re: touch (Was Re: -since option for ls -lt) Date: 24 Jun 88 00:17:31 GMT Posted: Thu Jun 23 19:17:31 1988 To: unix-wizards@SEM.BRL.MIL in article <712@ubu.warwick.UUCP>, maujd@warwick.UUCP (Geoff Rimmer) says: > In article <344@ajpo.sei.cmu.edu> jrkelly@ajpo.sei.cmu.edu (John Kelly) writes: >> >>Has anyone implemented any of the following for Unix: >> >> 1. a directory listing command with a -since option? >> 2. a program to force a specified modification time upon a specified file? >> 3. a program to compare two dates/times and return an appropriate status? >> >>where the dates/times are given in string form, as in the output of "date" and >>"ls"? > > #2 is already implemented on our (system V version) touch(1V) :- As Geoff noted, SYSV touch allows you to set the date to a specific time, whether future or past. BSD touch does not however. But then again, BSD will "force" a touch (via an -f option) even if the file is not writable (assuming you own the file or are the superuser). At my last check, SYSV has no provision to do this (Clarification anyone?). I got frustrated enough at the "gratuitous differences" between BSD and SYSV on this point that I wrote my own. It is written entirely without reference to BSD or SYSV source, but implements both features from BSD and SYSV. If some kind soul will mail instructions on how to distrubute via comp.unix.sources, I will share. For those of you who can't wait, send me mail and I will email directly. John Kelly: I would have emailed the source directly to you, but my mailer doesn't know how to get to you. (Dumb ain't it) If you can come up with a bang-style address, I'll send it to you. Russell Kent Phone: +1 214 995 3501 Texas Instruments UUCP address: P.O. Box 655012 MS 3635 ...!convex!smu!tifsie!kent Dallas, TX 75265 ...!ut-sally!im4u!ti-csl!tifsie!kent -- Russell Kent Phone: +1 214 995 3501 Texas Instruments UUCP address: P.O. Box 655012 MS 3635 ...!convex!smu!tifsie!kent Dallas, TX 75265 ...!ut-sally!im4u!ti-csl!tifsie!kent ----------------------------- From: "Chris Lewis (It's loose again!" <clewis@spectrix.uucp> MMDF-Warning: Parse error in original version of preceding line at BRL.ARPA Subject: Re: What do panic messages mean? Date: 23 Jun 88 21:31:59 GMT To: unix-wizards@SEM.BRL.MIL In article <170@pigs.UUCP> haugj@pigs.UUCP (The Beach Bum) writes: |In article <446@sysco>, chapman@sco.COM (brian chapman) writes: |] In article <2375@rpp386.UUCP> jfh@rpp386.UUCP (The Beach Bum) writes: |] [ DNA trap in kernel mode |] [ |] [ now, what i want to know is what is a DNA trap? does this mean the |] [ machine has been genetically mutated? |] |] On the chance that this is a serious question I will attempt |] to answer it. |] DNA is Device Not Availible (floating point device, that is) |] Meaning the kernel is executing *87 instructions. Or trying to. |] -- |] Brian Chapman uunet!sco!chapman | |OK - i thought it was a typo version of DMA trap. now that i know |its True Meaning(tm), how come i don't see it when i am executing |80387 instructions? i mean, i use floating point code, but never |see the message. does this only apply if the kernel thought there |was an 80387 and then later found out it had disappeared? you've |made me curious now! My suspicion is that "DNA trap in kernel mode" would only occur if the kernel itself tried to issue a FPU (or some other co-processor) instruction when no FPU (or other co-processor) was present. Though it is possible that this would occur if the ROM BIOS was so stupid as to tell the kernel during boot that the FPU was present, but it wasn't. Usually, UNIX kernels are designed to not have FPU instructions of their own. During system boot, the 386 kernel (this applies to most kernels all the way back to PDP-11 V7 or V6) determines whether the FP hardware is present. If the FP hardware is not present, then the kernel makes arrangements so that if a user tries to execute a FPU instruction, the kernel will catch the exception, emulate the instruction in *software*, and then continue the user's code. So, the user is never really aware whether there's a true FPU present except that software emulation is slower. Therefore, the compiler *always* emits true FPU instructions. [Just consider all the grief that wouldn't happen if DOS did the emulation of non-existant instructions in software too!] However, if the kernel does detect that an FP instruction was issued from itself, obviously something is wrong (the kernel should never depend on optional co-processors) and it panics. Sort of like having a page fault while in kernel mode (unless your kernel can page itself that is). ISC 386/ix used to (and I suspect Microport and Bell Tech still do) crash if the ROM BIOS was so stupid to tell the kernel during boot that the FPU was present but it really wasn't (which was a bug in several earlier 386 ROM BIOSes). Not all systems work this way (eg: Spectrix programs are linked with different libraries depending on whether a real hardware FPU is present), but 386 UNIXes do. -- Chris Lewis, Spectrix Microsystems Inc, Phone: (416)-474-1955 UUCP: {uunet!mnetor, utcsri!utzoo, lsuc, yunexus}!spectrix!clewis Moderator of the Ferret Mailing List (ferret-list,ferret-request@spectrix) ----------------------------- End of UNIX-WIZARDS Digest **************************
ted%nmsu.csnet@relay.cs.net (06/29/88)
Geoff Kratz writes:
...
Our main goal for getting the source is to gain some insight into the
system itself (the documentation enhancement you mentioned). For me
specifically, that means actually see what happens in the low-level
windowing (the documentation seems to be sparse or missing in places).
...
But, as I said before, our management would like to see some "revenue"
created directly because of the licence (you know, money for money) and
our department's arguments alone aren't sufficient.
For windowing, get X, the source is part of the distribution. You
don't get the source to sun-windows without very special arrangements
since it isn't really part of unix.
Other than that, source is not very important anymore, I have worked
both with and without it and it is a rare instance that you REALLY
need to hack on the source. Source is worth the university price for
general amusement of the sort that you have mentioned, but not worth
the commercial price unless it is part of a delivered product.