home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / question / 13775 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  211.4 KB

  1. Path: sparky!uunet!europa.asd.contel.com!gatech!psuvax1!rutgers!cmcl2!adm!news
  2. From: postmaster@ntsc-rd.navy.mil (SMTP MAILER)
  3. Newsgroups: comp.unix.questions
  4. Subject: Mail not delivered yet, still trying
  5. Message-ID: <34202@adm.brl.mil>
  6. Date: 22 Nov 92 18:06:49 GMT
  7. Sender: news@adm.brl.mil
  8. Lines: 5446
  9.  
  10.  
  11.  ----Mail status follows----
  12. Have been unable to send your mail to <slosser@ntsc-rd.navy.mil>,
  13. will keep trying for a total of three days.
  14. At that time your mail will be returned.
  15.  
  16.  ----Transcript of message follows----
  17. Date: 22 Nov 92 04:16:00 EST
  18. From: info-unix@BRL.MIL
  19. Subject: INFO-UNIX Digest  V17#010
  20. To: "rubel" <rubel@ntsc-rd.navy.mil>
  21. cc: "slosser" <slosser@ntsc-rd.navy.mil>
  22.  
  23. Return-Path: <info-unix-request@sem.brl.mil>
  24. Received: from SEM.BRL.MIL by ntsc-rd.navy.mil with SMTP ; 
  25.           Sun, 22 Nov 92 04:10:26 EST
  26. Received: from SEM.BRL.MIL by SEM.BRL.MIL id ac25769; 21 Nov 92 7:48 EST
  27. Received: from sem.brl.mil by SEM.BRL.MIL id aa25757; 21 Nov 92 7:37 EST
  28. Date:       Sat, 21 Nov 92 07:37:07 EST
  29. From:       The Moderator (Mike Muuss) <Info-Unix-Request@BRL.MIL>
  30. To:         INFO-UNIX@BRL.MIL
  31. Reply-To:   INFO-UNIX@BRL.MIL
  32. Subject:    INFO-UNIX Digest  V17#010
  33. Message-ID:  <9211210737.aa25757@SEM.BRL.MIL>
  34.  
  35. INFO-UNIX Digest          Sat, 21 Nov 1992              V17#010
  36.  
  37. Today's Topics:
  38.                          SCCS to RCS Conversion
  39.                         Re: IS UNIX DEAD (long)
  40.                         Passing args to login(1)
  41.                       Re: Passing args to login(1)
  42.                using the floppy drive on a sparcstation?
  43.              Re: using the floppy drive on a sparcstation?
  44.                 how do I know on which console I work ?
  45.               Re: how do I know on which console I work ?
  46.                      Re: pwd: getwd: can't open ..?
  47.              Re: Looking for Time Series Analysis software
  48.                        PostScript output from man
  49.               Mixing Unix 120& Novell on the same network?
  50.                  Re: Any terminfo compilers available?
  51.               Re: How do I increase number of screen rows?
  52.                          Re: Internet question
  53.                                 awk info
  54.                         Re: Unattended execution
  55.                        Re: What's HP Boat Format
  56.                      Re: Absurd! (Re: IS UNIX DEAD)
  57.              Re: It ain't a 24x80 world anymore. Or is it?
  58.               Re: How does a mortal become a UNIX WIZARD ?
  59.                         Re: IS UNIX DEAD? (long)
  60.                      Re: IS UNIX DEAD? (very long)
  61.                  Re: Recursive Tree Copy (with filter)?
  62.                            LaTeX Compilation
  63.            Welcome to comp.unix.questions [Biweekly posting]
  64.     Frequently Asked Questions about Unix (index) [Biweekly posting]
  65.      Frequently Asked Questions about Unix (1/7) [Biweekly posting]
  66.      Frequently Asked Questions about Unix (2/7) [Biweekly posting]
  67.      Frequently Asked Questions about Unix (4/7) [Biweekly posting]
  68.      Frequently Asked Questions about Unix (3/7) [Biweekly posting]
  69.      Frequently Asked Questions about Unix (5/7) [Biweekly posting]
  70.      Frequently Asked Questions about Unix (7/7) [Biweekly posting]
  71.      Frequently Asked Questions about Unix (6/7) [Biweekly posting]
  72.                     Re: What's wrong with select() ?
  73.                   Loking for a code for GIBBS SAMPLER
  74.                         general unix info needed
  75.   make, makefile where s.'s are in another directory, clean solution ?
  76.                     text search software(follow-up)
  77.       Utility for keeping two directories consistent (identical)?
  78.                                 Re: grep
  79. -----------------------------------------------------------------
  80.  
  81. From: "Fred J. Sena" <fjs@mrst.uucp>
  82. Subject: SCCS to RCS Conversion
  83. Date: 17 Nov 92 23:26:53 GMT
  84. Followup-To: comp.unix.programmer
  85. To:       info-unix@sem.brl.mil
  86.  
  87. hi,
  88.  
  89. I want to convert a bunch of source files from SCCS to RCS.  I have a tool
  90. called "sccstorcs" that came out around 1982, but I tried it on some files
  91. and it broke (on some branches, I think).  I would try and fix it, but first
  92. I thought that it would be a good idea to see if there is another version
  93. available.
  94.  
  95. I hope that there is a more up-to-date version available, that presumably
  96. would have this fixed.  If you have any information or know where I can
  97. obtain a good copy, I would really appreciate hearing from you.  Please
  98. email if possible, and I will post a summary to all of those who are
  99. interested.
  100.  
  101.     thanks,
  102.     -fred
  103.  
  104. -----------------------------
  105.  
  106. From: Peter Busser <peter@global.hacktic.nl>
  107. Subject: Re: IS UNIX DEAD (long)
  108. Date: 18 Nov 92 11:49:21 GMT
  109. To:       info-unix@sem.brl.mil
  110.  
  111. andy@research.canon.oz.au (Andy Newman) writes:
  112.  
  113. >papresco@napier.uwaterloo.ca (Paul Prescod) writes:
  114.  
  115. >>True, the problem is there are people, in this very newsgroup, who see
  116. >>no reason to try to make user friendly applications for unix.  To them,
  117. >>if you can't use VI right off the bat, or enjoy learning obscure, 
  118. >>nonsensical, illogical keystrokes, you should go back to the mac.
  119. >>THIS will kill Unix.
  120.  
  121. >Define "user friendly". Aren't the people who like vi users too?
  122.  
  123. Of course they are. But there are also easy to use editors availlable for X
  124. such as textedit (from the XView3 library) and aXe. The problem is that such
  125. an editor are not always delivered with a system and people are stuck to vi
  126. or emacs.
  127.  
  128. Greetings,
  129. Peter Busser
  130.  
  131. -----------------------------
  132.  
  133. From: Superuser <root@shiptile.chi.il.us>
  134. Subject: Re: IS UNIX DEAD (long)
  135. Date: 18 Nov 92 14:59:15 GMT
  136. To:       info-unix@sem.brl.mil
  137.  
  138. >True, the problem is there are people, in this very newsgroup, who see
  139. >no reason to try to make user friendly applications for unix.  To them,
  140. >if you can't use VI right off the bat, or enjoy learning obscure, 
  141. >nonsensical, illogical keystrokes, you should go back to the mac.
  142. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  143.  
  144. I don't understand why you would say this.  Most UNIX users (myself included)
  145. would consider UNIX keystrokes to be as sensible and logical as any other.
  146. Not meaning to offend the writer, but does (s)he use UNIX?
  147.  
  148. >THIS will kill Unix.
  149.  
  150. I doubt it.
  151.  
  152. -----------------------------
  153.  
  154. From: George Jetson <pynq@quads.uchicago.edu>
  155. Subject: Passing args to login(1)
  156. Date: 18 Nov 92 14:58:21 GMT
  157. Sender: News System <news@wakinyan.uchicago.edu>
  158. To:       info-unix@sem.brl.mil
  159.  
  160. I am pretty sure that under at least some versions of Unix/login, you can
  161. pass args in along with your login-id, and that these args would then be
  162. available to your .login/.profile.  See below:
  163.  
  164.     login: pynq and green
  165.     Password: 
  166.  
  167.     Then $1 should be "and" and $2 should be "green".
  168.  
  169. However, this doesn't seem to work under my current version of login
  170. (and version of SunOS [4.something])
  171.  
  172. So, my question is: "Am I imagining things, or am I doing it wrong?"
  173.  
  174. I could of course ask questions in the login script and branch
  175. accordingly, but it would be cleaner to be able to do it as a command
  176. line parameter.
  177.  
  178. ************************************************************************
  179. I've been told to back off on the diode jokes, but I still don't
  180. like smileys ;-)
  181.  
  182.     - pynq@quads.uchicago.edu, who is still costing the net
  183.       hundreds, if not thousands, of dollars, every time he posts -
  184. ************************************************************************
  185.  
  186. -----------------------------
  187.  
  188. From: Clarence Dold <dold@unislc.uucp>
  189. Subject: Re: Passing args to login(1)
  190. Date: 19 Nov 92 03:23:34 GMT
  191. To:       info-unix@sem.brl.mil
  192.  
  193. From article <92323.143304AASSI@CUNYVM.BITNET>, by abraham <AASSI@CUNYVM.BITNET>:
  194. >> From: pynq@quads.uchicago.edu (George Jetson)
  195. >> Subject: Passing args to login(1)
  196. >> Date: Wed, 18 Nov 1992 14:58:21 GMT
  197. >>
  198. >> I am pretty sure that under at least some versions of Unix/login, you can
  199. >> pass args in along with your login-id, and that these args would then be
  200. >> available to your .login/.profile.  See below:
  201. >>
  202. >>         login: pynq and green
  203. >>         Password:
  204. >>
  205. >>         Then $1 should be "and" and $2 should be "green".
  206.  
  207. Close.  The arguments are $L0="and", $L1="green", which you should have
  208. noticed, when you did an "env" after login.
  209.  
  210. However, I find that this isn't supported on all of the systems I tried, but
  211. it is on both SVR3.2 and SVR4 variants.
  212.  
  213. Check your "man login" to see if it is available. My SVR4:
  214. "          either the form xxx or xxx=yyy. Arguments without an equals
  215. "          sign are placed in the environment as
  216. "               Ln=xxx
  217. "          where n is a number starting at 0 and is incremented each
  218.  
  219. -- 
  220. ---
  221. Clarence A Dold - dold@unislc.slc.Unisys.COM
  222.                ...pyramid!ctnews!tsmiti!dold
  223.  
  224. -----------------------------
  225.  
  226. From: Shane Hutchins aka Xenos <sch@nymph.msel.unh.edu>
  227. Subject: using the floppy drive on a sparcstation?
  228. Date: 18 Nov 92 15:04:01 GMT
  229. NNTP-Posting-Host: nymph.msel.unh.edu
  230. To:       info-unix@sem.brl.mil
  231.  
  232. I'd like allow users to transfer files from the floppy drive on our
  233. Sun4 SPARCstation IPCs to their account.         (/dev/fd0)
  234.  
  235. Unfortunately, it requires root permissions to mount the thing.
  236.  
  237. Is there some freeware out there that will allow a user to mount /pcfs
  238. and eject (ie use the damn floppy drive) without root access.
  239.  
  240. Thanks for your help...
  241. -- 
  242.   -Shane C Hutchins
  243.      sch@unh.edu
  244.  
  245. -----------------------------
  246.  
  247. From: Clark Burdick <clark@gopher.stanford.edu>
  248. Subject: Re: using the floppy drive on a sparcstation?
  249. Date: 19 Nov 92 16:35:51 GMT
  250. Sender: Mr News <news@leland.stanford.edu>
  251. To:       info-unix@sem.brl.mil
  252.  
  253. In article <1edm11INNoom@mozz.unh.edu> sch@nymph.msel.unh.edu (Shane Hutchins aka Xenos) writes:
  254. >I'd like allow users to transfer files from the floppy drive on our
  255. >Sun4 SPARCstation IPCs to their account.         (/dev/fd0)
  256. >
  257. >Unfortunately, it requires root permissions to mount the thing.
  258. >
  259. >Is there some freeware out there that will allow a user to mount /pcfs
  260. >and eject (ie use the damn floppy drive) without root access.
  261. >
  262. >Thanks for your help...
  263. >-- 
  264. >  -Shane C Hutchins
  265. >     sch@unh.edu
  266.  
  267.  
  268. The program usermount is available from guardian.cs.psu.edu in the
  269. directory /pub/src for anonymous ftp. This program is very easy to install
  270. and allows users to mount floppy disks and cd-roms without root access.
  271.  
  272. Hope this helps,
  273. Clark Burdick
  274.  
  275. -----------------------------
  276.  
  277. From: errera alfred <errera@shum.cc.huji.ac.il>
  278. Subject: how do I know on which console I work ?
  279. Date: 18 Nov 92 15:53:03 GMT
  280. Nntp-Posting-Host: shum.cc.huji.ac.il
  281. To:       info-unix@sem.brl.mil
  282.  
  283. Hello.
  284. We have a system of some SPARC 1 & 2 and some sun386i used as X terminal.
  285. We do a lot of rlogin from one machine to another .
  286. My question is : how do I know what is the console I work on?
  287. namely how do I know the right setting for the DISPLAY variable so that
  288. X programs will run on my display even when I do rlogin ?
  289. please email or post the answer.
  290. thanks a lot.
  291. Eliel
  292. errera@shum.cc.huji.ac.il
  293.  
  294. -----------------------------
  295.  
  296. From: Michael Salmon <etxmesa@eos.ericsson.se>
  297. Subject: Re: how do I know on which console I work ?
  298. Date: 19 Nov 92 09:41:05 GMT
  299. Sender: news@ericsson.se
  300. Nntp-Posting-Host: eos6c02.ericsson.se
  301. To:       info-unix@sem.brl.mil
  302.  
  303. In article <1992Nov18.155304.736@vms.huji.ac.il>, errera@shum.cc.huji.ac.il (errera alfred) writes:
  304. |> Hello.
  305. |> We have a system of some SPARC 1 & 2 and some sun386i used as X terminal.
  306. |> We do a lot of rlogin from one machine to another .
  307. |> My question is : how do I know what is the console I work on?
  308. |> namely how do I know the right setting for the DISPLAY variable so that
  309. |> X programs will run on my display even when I do rlogin ?
  310. |> please email or post the answer.
  311. |> thanks a lot.
  312. |> Eliel
  313. |> errera@shum.cc.huji.ac.il
  314.  
  315. This is a repost. I have since used this technique very successfully.
  316. There is a catch though. Some systems only store the first 16
  317. characters of the remote sites name and that can cause a problem.
  318.  
  319. In article <3842@bimacs.BITNET> 
  320. yedidya@bimacs.BITNET (Yedidya Israel) writes:
  321. >
  322. >Hello net.
  323. >
  324. >Can I get help with writing a script that will define my DISPLAY
  325. >environment variable from .cshrc according to the environment I
  326. >telnetted/rlogined from.
  327. >
  328. >I.e. if I telnet from a regular terminal (say vt100) then do not
  329. >define $DISPLAY at all. If I telnet from an xterm or dxterm or aixterm
  330. >X environments define my $DISPLAY to the existing one (if exists) or
  331. >derive it from who am i.
  332.  
  333. On our Apollo (BSD) systems I do:
  334.  
  335. set host = `hostname`
  336. #
  337. # Set the default X Windows server name - set to the name of the host
  338. # the user logged in from, unless it was the terminal server (tserver).
  339. # Also strip off the local domain name (.chem.utoronto.ca) if possible.
  340. #
  341. setenv DISPLAY "${host}:0"
  342. set displayhost=`who am i | sed -e 's/.*(//' -e 's/).*$//' -e 's/\.chem\.utoronto\.ca$//'`
  343. if ("$#displayhost" == "1") then
  344.    if ("$displayhost" != "tserver") then
  345.       setenv DISPLAY $displayhost\:0
  346.    endif
  347. endif
  348. unset displayhost
  349.  
  350. and on our HP (SYSV-sortof) systems I do:
  351.  
  352. set host = `hostname`
  353. #
  354. # Set the default X Windows server name - set to the name of the host
  355. # the user logged in from, unless it was the terminal server (tserver).
  356. # Also strip off the local domain name (.chem.utoronto.ca) if possible.
  357. #
  358. setenv DISPLAY "${host}:0"
  359. tty -s
  360. if ("$status" == "0") then
  361.    set displayhost=`who am i -R | sed -e 's/.*(//' -e 's/).*$//' -e 's/\.chem\.utoronto\.ca$//'`
  362.    if ("$#displayhost" == "1") then
  363.       if ("$displayhost" != "tserver") then
  364.          setenv DISPLAY $displayhost\:0
  365.       endif
  366.    endif
  367.    unset displayhost
  368. endif
  369.  
  370. You will have to surround this with code to only do it for $TERM types
  371. you want. You'll just have to trust the user hasn't messed with $TERM;
  372. if the wrong $TERM is propagated from the remote system, tough luck for
  373. the user. It is possible to send some messages to some terminals
  374. and check the response (this works for vt100/xterm) so that might be
  375. a way to check out the terminal type.
  376. -- 
  377. What are the chances that any computer system will ever "work" properly?
  378.  ... and Slim just left town. -*- Mike Peterson, SysAdmin, U/Toronto Chemistry
  379.  
  380. -- 
  381.  
  382. Michael Salmon
  383.  
  384. #include    <standard.disclaimer>
  385. #include    <witty.saying>
  386. #include    <fancy.pseudo.graphics>
  387.  
  388. Ericsson Telecom AB
  389. Stockholm
  390.  
  391. -----------------------------
  392.  
  393. From: Art Dyer <ahd@apollo.sunquest.com>
  394. Subject: Re: pwd: getwd: can't open ..?
  395. Date: 18 Nov 92 16:31:28 GMT
  396. Sender: news@cs.arizona.edu
  397. To:       info-unix@sem.brl.mil
  398.  
  399. In article <Bxt31B.4Fn@uiag.ch> jonas@uiag.ch (Jonas Furrer) writes:
  400. >Hi,
  401. >
  402. >why I have this error -> pwd: getwd: can't open ..
  403. >
  404. > [...]
  405.  
  406. When I had this problem, it was because of the mode of the mount point
  407. (which you cannot see while the filesystem is mounted).  Unmount the
  408. filesystem and _then_ examine the mode of /files/disk2/imagery.
  409. --
  410. Art Dyer    ahd@apollo.sunquest.com    Voice:  (602) 570-2000
  411.  
  412. -----------------------------
  413.  
  414. From: "Stephen e. Rhody" <serhody@rodan.acs.syr.edu>
  415. Subject: Re: Looking for Time Series Analysis software
  416. Date: 18 Nov 92 16:56:48 GMT
  417. To:       info-unix@sem.brl.mil
  418.  
  419. In article <1992Nov17.051627.10815@midway.uchicago.edu> sjs6@midway.uchicago.edu writes:
  420. >
  421. >The leading program for time series analysis is probably RATS, which runs
  422. >under DOS, the Macintosh, Unix and perhaps some other operating systems
  423. >as well.
  424. >
  425. >The company that writes this is located in Evanston, IL.  Their name used
  426. >to be VAR econometrics, but they might well have changed it about a year ago
  427. >(perhaps to "Estima", but I could have them confused with another company).
  428. >
  429. >RATS stands for something like "regression analysis for time series" and 
  430. >contains a broad array of time series analysis functions including specral
  431. >analysis.
  432. >
  433. >If you cant track this down yourself, contact me by email and I will send
  434. >you the phone number.
  435. >
  436. >-- 
  437. >Jonathan Silverman
  438. >
  439. >sjs6@quads.uchicago.edu
  440. >jonat@cicero.spc.uchicago.edu
  441.  
  442.  
  443. From the RATS 4.0 manual:
  444.  
  445. Rats is produced by
  446.  
  447. Estima 1800 Sherman Ave., Suite 612
  448. Evanston, IL 60201
  449.  
  450. Phone Numbers:
  451.  
  452. (708) 864-8772    (General Information)
  453. (708) 864-1910    (Technical Support:  9am-5pm Central time)
  454. (708) 864-6221    (Fax)
  455. (708) 864-8816    (Bulletin Board)
  456.  
  457. Hope this helps
  458.  
  459. Steve
  460.  
  461. -----------------------------
  462.  
  463. From: Barbara Vaughan <bvaughan@sheps.princeton.edu>
  464. Subject: PostScript output from man
  465. Date: 18 Nov 92 20:16:27 GMT
  466. Sender: USENET News System <news@princeton.edu>
  467. Originator: news@nimaster
  468. Nntp-Posting-Host: sheps.princeton.edu
  469. To:       info-unix@sem.brl.mil
  470.  
  471. Can someone suggest a way of either getting PostScript output for a man
  472. page or finding the fully qualified path name for a man page.  Here is
  473. some background:
  474.  
  475. We have a PostScript printer (HP Laserjet 3si) that lets us print on both
  476. sides of a page using PostScript commands.  (About four lines of
  477. PostScript headers have to be prepended to an existing PostScript file.)  I
  478. have figured out how to
  479. implement this for everything but man pages.  If it's a TeX file, I use
  480. dvips to convert it to PostScript, if a plain text file, I use enscript. I've
  481. written a shell script that figures out what kind of file you have and
  482. that has a -d (for "duplex") command line switch so that even our most
  483. novice users can save paper, and I'd like to make a similar shell script
  484. for man pages so that you can say "manprint -d _command_" and you'll get a
  485. duplex-printed man page.  (Or maybe I could add a "-man" command line
  486. switch to my existing script.)  At any rate, I need PostScript output from
  487. the man page.
  488.  
  489. I've tried the following:
  490.  
  491. man -t _command_ >tempfile
  492. pscat tempfile 
  493.  
  494. (pscat fails and dumps core; this seems to be a pscat bug)
  495.  
  496. I have found that if I know the name of the man page file, I can use
  497. ptroff -t -man _man.page.file.name_ to produce a PostScript version of the
  498. man page, but our man pages reside on many different directories, so I
  499. would like a way to have my shell script identify the path/name of the file
  500. where the man page resides, so the user doesn't have to know this in advance.
  501.  
  502. I've also tried various ways of piping output of man directly to ptroff,
  503. This also fails, even if I set my TROFF environment variable to PTROFF. 
  504. The closest I get is a PostScript file containing nothing but headers and
  505. status dictionary, font definitions, etc.
  506.  
  507. Thanks for any help you can give,
  508.  
  509. Barbara Vaughan
  510.  
  511. -----------------------------
  512.  
  513. From: Kenneth Leung <allanon@sdf.lonestar.org>
  514. Subject: Mixing Unix \w TCPIP & Novell on the same network?
  515. Date: 18 Nov 92 21:27:43 GMT
  516. To:       info-unix@sem.brl.mil
  517.  
  518. I have a question about mixing Novell servers & Unix Servers on the same
  519. network.
  520.  
  521. Configuration : 1 SUN Sparc Server, 10 SCO Unix servers, 20 DOS PCs running
  522.         different TCP/IP Software such as FTP Software's PCTCP,
  523.         SUN NFS, ICE TCP & Chameleon TCP, over a Cabletron Ethernet
  524.         network.  The DOS PC runs telnet to different Unix machines
  525.         for different applications such as accounting or product
  526.         development.
  527.  
  528.  
  529. Now Management wants to put a Novell server in to the network and allow DOS
  530. users to access both Unix resources and Novell resources.  I am not too 
  531. familiar with Novell and how to mix it in with the TCP/IP network I am 
  532. currently running.  
  533.  
  534. Can I run dual protocols on the DOS PC to access both Unix and Novell?
  535. Can I use Unix or Novell to gateway between one another?  Any
  536. info would be helpful.
  537.  
  538. Thanks in advance.
  539.  
  540.  
  541. -- 
  542.  -------------------------------------------------------------------------------
  543. Kenneth C.P. Leung      /Sweda Division       --  Point of Sales Systems Co.
  544. Innovax Concepts Corp.  \Outsourcing Division --  Systems Planning & Consulting
  545. 1303 Walnut Hill Ln. 2nd Floor Irving TX 75038   Tel. 214-550-8371 x6828
  546.  
  547. -----------------------------
  548.  
  549. From: Ade Barkah <mbarkah@slate.mines.colorado.edu>
  550. Subject: Re: Any terminfo compilers available?
  551. Date: 19 Nov 92 00:40:20 GMT
  552. To:       info-unix@sem.brl.mil
  553.  
  554. bhays@teal.csn.org (Boyd Hays) writes:
  555. :     I need to write a program that parses terminfo source files. There was
  556. :     something available about 5 years ago, a small lex scanner, but I can't
  557. :     find it anywhere.
  558.  
  559. I'm not sure about where to find it, but since most Unices come with 
  560. the 'tic(1)' command, I'd say look at the free Unix directories
  561. (like linux or 386bsd) for the sources to tic.
  562.  
  563. I think GNU has a terminfo package, too... so you may want to
  564. grab it from your local ftp site and canniballize the source
  565. code (unless you're going to use it commercially, that is.)
  566.  
  567. Other than that, maybe you can play around with tic and achieve
  568. whatever you're trying to achieve...
  569.  
  570. -Ade.
  571. -- 
  572. Internet  : mbarkah@slate.mines.colorado.edu    (NeXT Mailable)
  573. CompuServe: 74160,3404
  574.  
  575. -----------------------------
  576.  
  577. From: Hans Mulder <hm@fwi.uva.nl>
  578. Subject: Re: How do I increase number of screen rows?
  579. Keywords: rows stty
  580. Date: 19 Nov 92 00:47:12 GMT
  581. Sender: news@fwi.uva.nl
  582. Nntp-Posting-Host: adam.fwi.uva.nl
  583. To:       info-unix@sem.brl.mil
  584.  
  585. In <lux.721768908@sol.UVic.CA> lux@sol.UVic.CA (Michael O'Henly) writes:
  586.  
  587. >    I want to increase the number of rows displayed by things like
  588. >emacs and nn from 24 to 35.
  589.  
  590. >    When I dial into my machine, the terminal window is defined as
  591. >24x80 and I can't quite figure out how to change it. I suspect it
  592. >involves the stty command, but 'stty rows 35' doesn't seem to tell
  593. >"full screen" emacs whatever it needs to know in order to address the
  594. >extra rows.
  595.  
  596. You need to say "stty rows 35 columns 80" (or whatever).
  597.  
  598. --
  599. HansM
  600.  
  601. -----------------------------
  602.  
  603. From: Ade Barkah <mbarkah@slate.mines.colorado.edu>
  604. Subject: Re: Internet question
  605. Date: 19 Nov 92 01:02:30 GMT
  606. To:       info-unix@sem.brl.mil
  607.  
  608. 13501TMC@MSU (Tim Casey) writes:
  609. :      Does anyone know the cost associated with getting Internet access from
  610. : home (i.e. a direct hookup compared to sharing time on a server)?
  611.  
  612. That greatly depends on what you want (i.e., the speed and type
  613. of the connection.) Using serial modems, 'SLIP' is the most popular
  614. method to connect to the net. Speeds range from 9600-38.4kbps,
  615. and the cost is around $200 a month depending on your internet
  616. provider. You'ld also need the appropriate software for this
  617. (inet packages for unix, plus the SLIP, which is actually free.
  618. DOS and OS/2 users probably need some sort of a TCP/IP package.
  619. I'd say they're around $150-$250.) Add whatever it will cost
  620. to have a dedicated phone line.
  621.  
  622. More dedicated lines are, of course, more expensive. Companies
  623. like UUNET have 56.4kbps leased lines available... it may cost
  624. around $1000 to set it up, and several hundred a month to run.
  625. Then there are T1/T3 lines. I think those cost about $3000 to
  626. set up and somewhere around $1000/month to run. For uunet, you
  627. can ftp their rates and policy from 'ftp.uu.net.' I'm not
  628. associated to uunet in any way, it's just that that's about
  629. the only company I'm vaguely familiar with.
  630.  
  631. Regards,
  632.  
  633.  
  634. -Ade.
  635. -- 
  636. Internet  : mbarkah@slate.mines.colorado.edu    (NeXT Mailable)
  637. CompuServe: 74160,3404
  638.  
  639. -----------------------------
  640.  
  641. From: Aaron Duncan <aaron@coombs.anu.edu.au>
  642. Subject: awk info
  643. Date: 19 Nov 92 01:46:53 GMT
  644. NNTP-Posting-Host: 150.203.76.2
  645. To:       info-unix@sem.brl.mil
  646.  
  647. I was wondering if anyone could tell me of any awk tutorials
  648. available on anonymous-ftp or any other useful source on the language.
  649.  
  650. Please mail me as I don't normally follow this group.
  651.  
  652. Thanks in advance,
  653.  
  654. Aaron Duncan
  655. aaron@coombs.anu.edu.au
  656.  
  657. -----------------------------
  658.  
  659. From: Kenneth Ng <ken@sugra.uucp>
  660. Subject: Re: Unattended execution
  661. Date: 19 Nov 92 03:39:26 GMT
  662. To:       info-unix@sem.brl.mil
  663.  
  664. In article <BxsH17.Cuu@magpie.nycenet.edu: manes@magpie.nycenet.edu (Steve Manes) writes:
  665. :Bob Lee (rlee@bgsu.edu) wrote:
  666. :: There is a task I want to perform, it includes recursively searching over
  667. :: 200 directories and over 1000 files for an occurance of a text string in
  668. :: any of the files. As you probably guessed, this task takes quite a while
  669. :: and I want to do it for more than one text string.
  670. :See at(C).
  671.  
  672. At on my machine will schedule a task to run at a certain time.  I had a real
  673. dangerous script that looked for printable files, greped out a string, and
  674. than ran sed to replace all occurrance of that string with a new string.
  675. Real dangerous if some novice decides to change all 'a' to 'b' :-).  The
  676. relevant part of the code is:
  677.  
  678. gfind . -type f -print | xargs printable | xargs grep "stuff" \
  679. | awk -F: '{ print $1 }' | sort | uniq
  680.  
  681. Now, what this does in english :-).  gfind finds all files I want to deal
  682. with, modify to your hearts content.  'printable' was a local function to
  683. determine what files one wanted to look at (it ignored object code, data
  684. bases, etc), the grep searches for the string I want, the awk yanks out
  685. the file name, the 'sort | uniq' gives me a unique list of the files that
  686. contain the string.  And for the curious, this is the program I piped the
  687. output into to change all the strings (from memory):
  688.  
  689. #! /bin/csh
  690. foreach file ($*)
  691.    cp ${file} ${file}.save
  692.    sed 's/old/new/g' < ${file}.save > ${file}
  693.    end
  694.  
  695. Be warned, this routine can be VERY dangerous if you are not real careful
  696. about what you want to change.
  697.  
  698.  
  699. -- 
  700. Kenneth Ng
  701. Please reply to ken@eies2.njit.edu for now.
  702. Apple and AT&T lawsuits: Just say NO!
  703.  
  704. -----------------------------
  705.  
  706. From: Thad P Floryan <thad@cup.portal.com>
  707. Subject: Re: What's HP Boat Format
  708. Date: 19 Nov 92 06:48:27 GMT
  709. To:       info-unix@sem.brl.mil
  710.  
  711. In article <1992Nov16.180950.21931@leland.Stanford.EDU>
  712. donghao@leland.Stanford.EDU (dong hao zhang) writes:
  713.  
  714. |  I have a 3.5 inch floppy disk to read. The disk is marked HP boat format.
  715. |  Is this the disk format for HP workstations ? I appreciate any response to
  716. |  donghao@leland.stanford.edu
  717. |  
  718. |  Sorry if this isn't quite a unix question, but couldn't find any place
  719. |  better.
  720.  
  721. "HP boat format"?   Sounds like a question for the "rec.boating" newsgroup.
  722.  
  723. Naw, cannot make the same typo twice (article header and article body), so:
  724.  
  725. 102' fibreglass hull, twin diesels.  And the 3-1/2" disks make nice hub
  726. shims for my Penn Ocean reels, especially important when using 150 pound/test
  727. line.  Just don't get caught dropping a line in at HP's Monterey Bay Aquarium.
  728.  
  729. HP also has two corporate airplanes mfd. by Lockheed; those would be the
  730. "HP airplane format".
  731.  
  732. :-)  :-)  :-)
  733.  
  734. Seriously, though the disk may be marked "BOOT format", is that what's really
  735. on the disk?  In other words, did someone simply re-use a boot disk to send
  736. you stuff?
  737.  
  738. Thad Floryan [ thad@btr.com, thad@cup.portal.com ]
  739.  
  740. -----------------------------
  741.  
  742. From: Scott Sanbeg <ssanbeg@visual.spk.wa.us>
  743. Subject: Re: Absurd! (Re: IS UNIX DEAD)
  744. Date: 19 Nov 92 07:51:17 GMT
  745. To:       info-unix@sem.brl.mil
  746.  
  747. In article <Bxvu0w.BwD@research.canon.oz.au> luke@research.canon.oz.au (Luke Kendall) writes:
  748. >This `is Unix dead' is one of the most stupid subjects I have ever seen
  749. >discussed.
  750.  
  751. Agreed. From my own perspective UNIX was designed with elegance built
  752. in that has survived to this day - neophtes to the OS haven't changed
  753. that opinion. Is would be easiest to manage if the thread, though, stay
  754. under the '..UNIX DEAD' Subject line for a single kill file entry.
  755. Scott
  756.  
  757.  
  758. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  759. Scott Sanbeg     UNIX Systems Administrator       (509)535-2561
  760. ssanbeg@visual.spk.wa.us (or) ...!uunet!tau-ceti!visual!ssanbeg
  761.  
  762. -----------------------------
  763.  
  764. From: Tero Laakkonen <laakkone@klaava.helsinki.fi>
  765. Subject: Re: Absurd! (Re: IS UNIX DEAD)
  766. Date: 19 Nov 92 09:27:04 GMT
  767. To:       info-unix@sem.brl.mil
  768.  
  769. In <Bxvu0w.BwD@research.canon.oz.au> luke@research.canon.oz.au (Luke Kendall) writes:
  770.  
  771. >This `is Unix dead' is one of the most stupid subjects I have ever seen
  772. >discussed.
  773. >  1) Some people seem to be confusing operating systems with the
  774. >     applications that run under the OS.
  775.  
  776. i agree with this. what also irritates me is people continuously
  777. changing the subject line ...
  778.  
  779. -tero
  780.  
  781. -----------------------------
  782.  
  783. From: Michael Salmon <etxmesa@eos.ericsson.se>
  784. Subject: Re: It ain't a 24x80 world anymore. Or is it?
  785. Date: 19 Nov 92 09:09:38 GMT
  786. Sender: news@ericsson.se
  787. Nntp-Posting-Host: eos6c02.ericsson.se
  788. To:       info-unix@sem.brl.mil
  789.  
  790. In article <lux.722129357@sol.UVic.CA>, 
  791. lux@sol.UVic.CA (Michael O'Henly) writes:
  792. |>     A few days ago I posted a query about how to increase the number
  793. |> of rows displayed in a terminal window so that 'full-screen' commands
  794. |> like emacs could make use 35 lines instead of the usual 24.
  795. |> 
  796. |>     I got some responses that suggested "stty rows 35" or "setenv
  797. |> LINES 35". I've tried both and, while they do alter the terminal's
  798. |> behaviour, they don't give me a 35-line screen. What I'm getting looks
  799. |> like this: lines 1-24 after a screen-clear display correctly, but
  800. |> lines 25-35 pile up on top of each other on the 24th line.
  801. |> 
  802. |>     So maybe I didn't ask the right question. What I'm trying to do is
  803. |> make the best use of my laptop screen when I dial into my machine
  804. |> using a modem and terminal emulator. Does the fact that I'm dialing in
  805. |> make a difference? I'm sure there _must_ be a way of working with more
  806. |> than a 24x80 display under these circumstances.
  807.  
  808. I use SunOS 4.1.1 and I mention that only because it reflects the
  809. curses that I use. When I use an xterm window it sets the TERMCAP
  810. environment variable to the value stored in the terminfo database but
  811. with the #li and #co values set to the correct size. tcsh updates this
  812. whenever it receives the window has changed size signal (SIGWINCH). I
  813. think that the problem with setting LINES is that you are telling the
  814. program how long the screen is but curses still believes that it is 24.
  815. I suggest therefore that you set your TERMCAP variable to suit, the
  816. resize program in the X11 release may be of some use, at least as a
  817. starting point.
  818.  
  819. -- 
  820.  
  821. Michael Salmon
  822.  
  823. #include    <standard.disclaimer>
  824. #include    <witty.saying>
  825. #include    <fancy.pseudo.graphics>
  826.  
  827. Ericsson Telecom AB
  828. Stockholm
  829.  
  830. -----------------------------
  831.  
  832. From: Roberto Shironoshita <shirono@ssd.csd.harris.com>
  833. Subject: Re: It ain't a 24x80 world anymore. Or is it?
  834. Date: 19 Nov 92 16:44:21 GMT
  835. NNTP-Posting-Host: gcx1.ssd.csd.harris.com
  836. To:       info-unix@sem.brl.mil
  837.  
  838. In article <lux.722129357@sol.UVic.CA> lux@sol.UVic.CA (Michael O'Henly) writes:
  839.  
  840. >     I got some responses that suggested "stty rows 35" or "setenv
  841. > LINES 35". I've tried both and, while they do alter the terminal's
  842. > behaviour, they don't give me a 35-line screen. What I'm getting looks
  843. > like this: lines 1-24 after a screen-clear display correctly, but
  844. > lines 25-35 pile up on top of each other on the 24th line.
  845. >
  846. >     So maybe I didn't ask the right question. What I'm trying to do is
  847. > make the best use of my laptop screen when I dial into my machine
  848. > using a modem and terminal emulator. Does the fact that I'm dialing in
  849. > make a difference? I'm sure there _must_ be a way of working with more
  850. > than a 24x80 display under these circumstances.
  851.  
  852. Does your terminal emulator support more than 24 lines?  From your
  853. description of what happens when you instruct your applications that you
  854. have a 35-line display, it sounds as if your terminal emulator is happily
  855. piling the last 12 lines on top of one another.
  856.  
  857. I have had no problems using xterm in a non-standard size (e.g. 55x80) to
  858. rlogin to other systems where I told vi that my line-count was 55.
  859. --
  860.  
  861.      Roberto Shironoshita      ||   Internet: shirono@ssd.csd.harris.com
  862.       Harris Corporation       ||
  863.    Computer Systems Division   ||   UUCP: ...!uunet!ssd.csd.harris.com!shirono
  864.                                ||
  865. DISCLAIMER: The opinions expressed here are my own; they in no way reflect the
  866.             opinion or policies of Harris Corporation.
  867.  
  868. -----------------------------
  869.  
  870. From: Elizabeth Haley <haley@husc11.harvard.edu>
  871. Subject: Re: How does a mortal become a UNIX WIZARD ?
  872. Date: 19 Nov 92 10:26:22 GMT
  873. Nntp-Posting-Host: husc11.harvard.edu
  874. To:       info-unix@sem.brl.mil
  875.  
  876. mbarkah@slate.mines.colorado.edu (Ade Barkah) writes:
  877.  
  878.  
  879. >What does it take for a man, er, person, to become a Unix Wizard ?
  880.  
  881. >Which bibles should we study ? (after memorizing O'Rileys to become
  882. >  an X Wizzie ?)
  883. K & R C, and anything release by ATT, then all the code released by
  884. BSD.
  885. You shoud know them by heart...
  886. >How many kernels (and which ones) we need to take apart and reassemble ?
  887. All of them.
  888. >Some doth say that the only way thou shall gain salvation is to
  889. >partake in the (sacrireligios) ceremony of rewriting Unix from
  890. >scratch.
  891. No, merely write a small working kernal by using
  892. cat > kmem
  893.  
  894. >So, oh, mylord, how does a mortal become a Unix Wizard ?
  895. Seriously, time, and much study.
  896. Write programs, write device drivers, reconfigure your kernal 1000
  897. thousand times, to make a little faster or a little more efficient...
  898. Get a 386 box, and get 386BSD running on it, then go through the code
  899. for it until you understand how it all adds up.
  900. Then you will be a *novice* wizard :-)
  901. Or read the FAQ in comp.unix.wizards, and follow that view...
  902.  
  903. >(next question: how does a newbie become a net.personality ?)
  904. Have an answer for everything, either useful or useless...
  905. >(ade barkah)
  906. >-- 
  907. >Internet  : mbarkah@slate.mines.colorado.edu    (NeXT Mailable)
  908. >CompuServe: 74160,3404
  909. -- 
  910. =---------------------------------------------------------------------------=
  911. =The author of this letter is a fabulously intelligent person and is very   =
  912. =Silly. She is also remarkably well loved, by the author of this signature. =
  913. =---------------------------haley@husc9.harvard.edu-------------------------=
  914.  
  915. -----------------------------
  916.  
  917. From: "John D. Boggs" <jboggs@umaxc.weeg.uiowa.edu>
  918. Subject: Re: How does a mortal become a UNIX WIZARD ?
  919. Date: 20 Nov 92 14:19:23 GMT
  920. Sender: "John D. Boggs" <jboggs@umaxc.weeg.uiowa.edu>
  921. To:       info-unix@sem.brl.mil
  922.  
  923. From article <Mf30lBO00VI=41tGYT@andrew.cmu.edu>, by Geoffrey Spear <gs32+@andrew.cmu.edu>:
  924. >     Also, read the jargon file and start using obscure hacker jargon all
  925. > the time.  It will at least make you *seem* to be a wizard of some sort,
  926. > at least to those who have no idea what you're talking about and who are
  927. > afraid to admit it :)
  928.  
  929. Plus there's the fact that some poet (Auden?) said that we all pretend to
  930. be something before we really are it, so yeah, pretending to be a Unix 
  931. wizard is a step in the right direction.
  932.  
  933. > "You're redlining my bogometer!"
  934.                        ~~~~~~~~~
  935. Hey!  You making fun of my name??!
  936.  
  937. -John D. Boggs     uunet!erato!jdb
  938.  
  939. -----------------------------
  940.  
  941. From: Peter Busser <peter@global.hacktic.nl>
  942. Subject: Re: IS UNIX DEAD? (long)
  943. Date: 20 Nov 92 00:38:31 GMT
  944. To:       info-unix@sem.brl.mil
  945.  
  946. lytras@avalon.physik.unizh.ch (Apostolos Lytras) writes:
  947.  
  948. >Well, let's see:
  949.  
  950. >(let's take book editing software for an example)
  951.  
  952. >FrameMaker:  about $3000 (if I convert the swiss price to US$, might be
  953. >                          less in the US, however)
  954.  
  955. >You get almost the same under UNIX from
  956. >Emacs & TeX:       $0 (maybe you'll have to add media cost)
  957.  
  958. That's rediculous! emTeX for DOS or OS/2 costs as much and offers as much. But
  959. it isn't Framemaker. So what you say here has nothing to do with what were
  960. talking about: the difference in numbers and prices of applications.
  961.  
  962. >Or take some table editing programs (spreadsheets), that offer macros:
  963. >Excel:  well.... $500?
  964. >Perl:              $0
  965.  
  966. Sorry, but these are rediculous comparissons. You can't compare a bicycle with
  967. an train. Just like you can't compare X11 with COMMAND.COM. I mean, Perl and
  968. Excel are two completely different kind of programs. I can program a
  969. spreadsheet in C, but that doesn't make C a spreadsheet... Or does it?
  970.  
  971. >Maybe you start to understand now why I just *love* UNIX... it just
  972. >compares favorably with DOS, and I don't give a **** about
  973. >"user-friendly" interfaces which seem to be in the way all the time (to
  974. >the experienced user, at least). 
  975.  
  976. I agree, but we were not discussing what you or I like. For me personally, I
  977. couldn't care less if UNIX is going to change or not. But, it might be better
  978. for UNIX to have a larger market. It might get squashed between other products
  979. if it doesn't grow.
  980.  
  981. >Did you ever look at what the cost is for adding your DOS/Windows-PC to
  982. >a network?
  983.  
  984. I know, don't tell me things I knew for years. I'm not a DOS user, I don't
  985. like the dumb PC networks like Novell and others. You don't need to convince
  986. me about the good things of UNIX (and not of the bad things :). The point is,
  987. you can't say: "Hey, look at this nice hacker friendly whiz-bang UNIX system
  988. with a feeping creaturizm shell, a nice VI editor and gcc, make, Perl, awk,
  989. TCP/IP, NFS, X, and all the other goodies installed!". I like it, you like it,
  990. but it scares other people.
  991.  
  992. The argument about connecting PCs to a network: well who cares? A UNIX machine
  993. has an administrator (according to some posters here), well so has a PC
  994. network. Period.
  995.  
  996. "But the system wasn't ment for end-users". It's an invalid argument, the
  997. system as in operating system, was ment for interactive use. The *user
  998. interface*, was ment for hackers. There is no reason why we can't have a
  999. second user interface that was ment for end-users. Preferably a consistent
  1000. GUI. Even MS-DOS offers a shell and I think it even installs by default. So
  1001. why can't most UNIXes have such a thing?
  1002.  
  1003. -----------------------------
  1004.  
  1005. From: Apostolos Lytras <lytras@avalon.physik.unizh.ch>
  1006. Subject: Re: IS UNIX DEAD? (long)
  1007. Date: 20 Nov 92 15:04:13 GMT
  1008. Sender: USENET News Admin <news@ifi.unizh.ch>
  1009. Nntp-Posting-Host: avalon
  1010. To:       info-unix@sem.brl.mil
  1011.  
  1012.  
  1013. In article <1992Nov20.003831.969@global.hacktic.nl> you write:
  1014. >That's rediculous! emTeX for DOS or OS/2 costs as much and offers as much. But
  1015. >it isn't Framemaker. So what you say here has nothing to do with what were
  1016. >talking about: the difference in numbers and prices of applications.
  1017.  
  1018. Indeed, it's not framemaker, and it doesn't offer the same things
  1019. either, but it's far superior to framemaker. That's why the comparison
  1020. may be ridiculous, but that's just because prices for useless apps like
  1021. framemaker are THAT high. Maybe you're right, the comparison was just
  1022. TOO flattering for FrameMaker. But I wanted to compare with something
  1023. that is available on the same amount of hardware on both sides, which is
  1024. - as you say - a ridiculous thing to try, because DOS is dead, and UNIX
  1025. isn't.
  1026.  
  1027. [Perl and Excel]
  1028. >Sorry, but these are rediculous comparissons. You can't compare a bicycle with
  1029. >an train. Just like you can't compare X11 with COMMAND.COM. I mean, Perl and
  1030. >Excel are two completely different kind of programs. I can program a
  1031. >spreadsheet in C, but that doesn't make C a spreadsheet... Or does it?
  1032.  
  1033. You can program a spreadsheet in Excel, too, and it doesn't make Excel a
  1034. spreadsheet either (I won't indulge in my views on spreadsheets, because
  1035. then I'd have to justify my belief that spreadsheets are the most
  1036. useless applications ever invented, worse than computer games). The
  1037. comparison just works, because Excel isn't a spreadsheet, you have to
  1038. program it in a cryptic macro language to get real use from it, and it
  1039. will be slower than perl, once you finished. Same applies to perl, but
  1040. it's faster and cheaper. I had to evaluate a few megabytes of numeric
  1041. data this fall and did it in both, so I know what I'm talking about,
  1042. perl just did the job a) EASIER!, b) faster, c) cheaper than Excel.
  1043. We're talking business here, and time is money, I just can't afford to
  1044. pay $500 and get less performance than from free software.
  1045.  
  1046. >I know, don't tell me things I knew for years. I'm not a DOS user, I don't
  1047. >like the dumb PC networks like Novell and others. You don't need to convince
  1048. >me about the good things of UNIX (and not of the bad things :). The point is,
  1049. >you can't say: "Hey, look at this nice hacker friendly whiz-bang UNIX system
  1050. >with a feeping creaturizm shell, a nice VI editor and gcc, make, Perl, awk,
  1051. >TCP/IP, NFS, X, and all the other goodies installed!". I like it, you like it,
  1052. >but it scares other people.
  1053.  
  1054. And you get impressed by the masses. There is a saying in switzerland
  1055. that goes: "Eat cow shit, millions of flies can't be wrong". It might
  1056. scare somebody, but we are experiencing an enormous growth in computer
  1057. knowledge among our population, so we're just not anymore at a point
  1058. where computers absolutely HAVE to have an interface with annoying
  1059. dialog boxes flashing up every other second. These people want
  1060. performance, they want to get their jobs done, and they have the
  1061. knowledge to handle a computer that is hacker friendly. These people are
  1062. UNIX people, and the market will grow, because they are on the rise. Why
  1063. stop them with awkward user interfaces, that have been licensed and
  1064. implemented by bozos? 
  1065.  
  1066. >The argument about connecting PCs to a network: well who cares? A UNIX machine
  1067. >has an administrator (according to some posters here), well so has a PC
  1068. >network. Period.
  1069.  
  1070. *laugh* You must be joking. WHICH PC network, if you please? I don't see
  1071. many PC's networking, when you look at the market as a whole, and why is
  1072. that so?
  1073.  
  1074. >"But the system wasn't ment for end-users". It's an invalid argument, the
  1075. >system as in operating system, was ment for interactive use. The *user
  1076. >interface*, was ment for hackers. There is no reason why we can't have a
  1077. >second user interface that was ment for end-users. Preferably a consistent
  1078. >GUI. Even MS-DOS offers a shell and I think it even installs by default. So
  1079. >why can't most UNIXes have such a thing?
  1080.  
  1081. That wasn't my argument, but let me answer to this quickly.
  1082. NeXTstep has it, OpenWindows has it, OSF/1 has it... even Linux has
  1083. one. In fact, only DOS users don't have one consistent GUI (windows is a
  1084. joke, windows NT will be a bad joke, os/2 adds to this variety, a.s.o).
  1085.  
  1086. Cheers
  1087. - A.
  1088.  
  1089. -- 
  1090.      lytras@ifi.unizh.ch           |   Apostolos Lytras
  1091.      lytras@avalon.physik.unizh.ch    |   Informatik Club der Uni
  1092.      lytras@amiga.physik.unizh.ch      |   Zuerich, SysAdmin
  1093.  
  1094. -----------------------------
  1095.  
  1096. From: Rob McMahon <cudcv@csv.warwick.ac.uk>
  1097. Subject: Re: IS UNIX DEAD? (long)
  1098. Date: 20 Nov 92 16:28:20 GMT
  1099. NNTP-Posting-Host: sprocket.csv.warwick.ac.uk
  1100. To:       info-unix@sem.brl.mil
  1101.  
  1102. In article <1992Nov20.003831.969@global.hacktic.nl> peter@global.hacktic.nl
  1103. (Peter Busser) writes: 
  1104. >>FrameMaker:  about $3000 (if I convert the swiss price to US$, might be
  1105. >>                          less in the US, however)
  1106. >
  1107. >>You get almost the same under UNIX from
  1108. >>Emacs & TeX:       $0 (maybe you'll have to add media cost)
  1109. >
  1110. >That's rediculous! emTeX for DOS or OS/2 costs as much and offers as much. But
  1111. >it isn't Framemaker. So what you say here has nothing to do with what were
  1112. >talking about: the difference in numbers and prices of applications.
  1113.  
  1114. Comparing emacs & TeX with FrameMaker is indeed ridiculous (although I confess
  1115. I prefer working that way), but FrameMaker cost us <\pounds 200 one-off,
  1116. including printed documentation, ~\pounds 100 each for more than 5 floating
  1117. licences, running on Sun workstations.  Interleaf came in at something like
  1118. \pounds 30-40 a licence, but FrameMaker seemed to be worth the extra money.
  1119. That't not so ridiculous.
  1120.  
  1121. Rob
  1122. -- 
  1123. UUCP:   ...!mcsun!uknet!warwick!cudcv    PHONE:  +44 203 523037
  1124. JANET:  cudcv@uk.ac.warwick             INET:   cudcv@warwick.ac.uk
  1125. Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
  1126.  
  1127. -----------------------------
  1128.  
  1129. From: Peter Busser <peter@global.hacktic.nl>
  1130. Subject: Re: IS UNIX DEAD? (very long)
  1131. Date: 20 Nov 92 00:45:06 GMT
  1132. To:       info-unix@sem.brl.mil
  1133.  
  1134. papresco@undergrad.math.waterloo.edu (Paul Prescod) writes:
  1135.  
  1136. >Non standard QWERTY-incompliant keyboards are certainly not my problem.
  1137. >99.9% of qwerty keyboards (and every one I have seen) has a semicolon beside
  1138. >the l.  The other .1% are so nonstandard that perhaps their hjkl aren't
  1139. >in a row either.
  1140.  
  1141. _American_ keyboards you mean...
  1142.  
  1143. >Thus the beauty of the (till now) unused F1 key.  Besides, one would
  1144. >assume that VI would be configurable enough that you could change the
  1145. >key mappings of the keys!  Or at least turn off help if you wanted to.
  1146.  
  1147. :map
  1148.  
  1149. -----------------------------
  1150.  
  1151. From: Craig Marby <marby@laura.harvard.edu>
  1152. Subject: Re: Recursive Tree Copy (with filter)?
  1153. Date: 20 Nov 92 02:16:54 GMT
  1154. Sender: usenet@hsdndev.uucp
  1155. To:       info-unix@sem.brl.mil
  1156.  
  1157. >>>>> On 19 Nov 92 21:17:48 GMT, trw@unixland.natick.ma.us (Tim Weil) said:
  1158.  
  1159. Tim> I need a utility that would perform a recursive tree copy but only 
  1160. Tim> operates on a selected file set for transfers.  The specific problem
  1161. Tim> concerns a complicated source tree with Makefiles embedded at various
  1162. Tim> sub-directories throughout the tree.
  1163. Tim>  
  1164. Tim> What the utility might do is behave like "cp -r" and "grep make *"
  1165. Tim> where any file prepended with "make" would be copied along with the
  1166. Tim> attached subdirectory.
  1167. Tim>  
  1168.  
  1169. What you need to do is a find/cpio -p. In other words generate your
  1170. filter or whatever using find -- if that doesn't quite give you
  1171. what you want you can redirect the find to an output file and
  1172. then edit that. Once you have your list of files you then send this
  1173. on to cpio -p, that is cpio with the "-p" option. See the manual
  1174. for details. You may wish to do a mini-experiment first!
  1175.  
  1176. Hope this helps.
  1177.  
  1178.     __o         
  1179.   _ \<,_       Craig A. Marby    marby@layla.harvard.edu
  1180.  (_)/ (_)      
  1181. ~~~~~~~~~~
  1182. --
  1183.  
  1184.     __o         
  1185.   _ \<,_       Craig A. Marby    marby@layla.harvard.edu
  1186.  (_)/ (_)      
  1187. ~~~~~~~~~~
  1188.  
  1189. -----------------------------
  1190.  
  1191. From: Mike Miller <millerm@skie.ece.orst.edu>
  1192. Subject: LaTeX Compilation
  1193. Keywords: LaTeX TeX Apollo DomainOS
  1194. Date: 20 Nov 92 02:36:28 GMT
  1195. NNTP-Posting-Host: skie.ece.orst.edu
  1196. To:       info-unix@sem.brl.mil
  1197.  
  1198. Has anyone had any success in compiling the LaTeX code on HP/Apollo  
  1199. DomainOS 10.3? We are having a great deal of difficulities in compiling  
  1200. the code due to diffrences and quirks in the DomainOS.
  1201.  
  1202. If you have any knowledge of how to, or how not to, or have the modified  
  1203. code (or bin) files we would greatly appreicate it if you could contact us  
  1204. via email as we often do not get the chance to read all of the news on a  
  1205. regular basis.
  1206.  
  1207. Thank you for you time and consideration.
  1208.  
  1209. ECE Support, Oregon State University
  1210. millerm@skie.ece.orst.edu    ---NeXT mail accepted---
  1211.  
  1212. -----------------------------
  1213.  
  1214. From: Ted M A Timar <tmatimar@empress.com>
  1215. Subject: Welcome to comp.unix.questions [Biweekly posting]
  1216. Date: 20 Nov 92 06:00:32 GMT
  1217. Expires: 18 Dec 1992 06:00:22 GMT
  1218. Followup-To: comp.unix.questions
  1219. Approved: news-answers-request@MIT.Edu
  1220. Supersedes: <unix-faq/unix-intro_721029617@athena.mit.edu>
  1221. NNTP-Posting-Host: pit-manager.mit.edu
  1222. X-Last-Updated: 1992/10/21
  1223. To:       info-unix@sem.brl.mil
  1224.  
  1225. Archive-name: unix-faq/unix-intro
  1226. Version: $Id: unix-intro,v 2.0 92/10/20 12:08:28 tmatimar Exp $
  1227.  
  1228. Comp.unix.questions is one of the most popular and highest volume
  1229. newsgroups on Usenet.  This article is a monthly attempt to remind
  1230. potential posters about what is appropriate for this newsgroup.
  1231. If you would like to make any suggestions about the content of
  1232. this article, please contact its maintainer at
  1233. tmatimar@empress.com.
  1234.  
  1235. Companion articles include the answers to some Frequently
  1236. Asked Questions.  You may save yourself a lot of time by reading
  1237. those articles before posting a question to the net.
  1238.  
  1239. If you have not already read the overall Usenet introductory material
  1240. posted to "news.announce.newusers", please do.  Much of this article
  1241. overlaps with the common sense guidelines posted there.
  1242.  
  1243.          Should I Post My Unix Question to the Net?
  1244.  
  1245. Often the answer is "No, you can get an answer a lot faster without
  1246. posting a question." Before you post, you should try -
  1247.  
  1248.     o Reading the manual for your system.  Some day you may encounter
  1249.       the phrase "RTFM", which stands for "Read the Fine Manual"
  1250.       (except 'F' doesn't really stand for "Fine").  If you ask
  1251.       someone a question and they tell you to RTFM, it's an
  1252.       indication that you haven't done your homework.   For instance,
  1253.       if you are having trouble removing a file whose name begins
  1254.       with a "-", check the man page for "rm".  It might tell
  1255.       you what you need to know.
  1256.  
  1257.       When people use terminology like "read(2)", they are referring
  1258.       to the "read" man page in section 2 of the manual (which you
  1259.       would see by using "man 2 read").
  1260.  
  1261.     o Finding a knowledgeable user at your site.  Many sites have
  1262.       at least a few Unix experts who will be happy to help you
  1263.       figure out how to remove a file whose name begins with "-".
  1264.       Many larger sites, particularly universities, may even have
  1265.       paid consultants whose job is to help you with Unix problems.
  1266.       Check with them first.
  1267.  
  1268.     o Find a good introductory book on Unix.  There are plenty of
  1269.       such books available, and you will save yourself a lot
  1270.       of trouble by having one handy and consulting it frequently.
  1271.       (Question 1.5 in the companion articles will let you know
  1272.        where you can find a list of good Unix and C books.)
  1273.  
  1274. Please remember that the comp.unix.* newsgroups are read by over 80,000
  1275. people around the world, and that posting a question to this group will
  1276. cost a lot of time and money by the time your article is distributed to
  1277. Asia, Australia, Europe (west and east), Africa, the middle east,
  1278. and all corners of North, South and Central America.
  1279.  
  1280. Also, some people receive these newsgroups as part of a mailing list
  1281. rather than a newsgroup.  If you're one of these people, please don't
  1282. send a "Remove me from this list" or "UNSUBSCRIBE"  message to the
  1283. wrong place.  Take the time to figure out where you're getting this
  1284. stuff from, and send your request to the mailing list maintainer, *not*
  1285. to the list or newsgroup itself!  Ask your local postmaster for help.
  1286. (One of the answers in the companion articles deals with the details of
  1287. the mailing list.)
  1288.  
  1289.                To Which Newsgroup Should I Post My Question?
  1290.  
  1291. The choice of newsgroup is harder than it used to be.  In the old days,
  1292. you just had to choose between "comp.unix.questions" and
  1293. "comp.unix.wizards".  Now there are a variety of more specific groups.
  1294. Choose one of the following groups carefully.  If you aren't sure where
  1295. your question belongs or if your question is not specific to some
  1296. particular version of Unix, try "comp.unix.questions".  Many
  1297. knowledgeable Unix wizards read that group and will be able to help you.
  1298.  
  1299. Here are the capsule descriptions of various groups you might consider
  1300. (extracted from a monthly posting to "news.announce.newusers")
  1301.  
  1302. comp.unix.questions     General questions from UNIX users and sys admins.
  1303.             If your question isn't a really good match for one of
  1304.             the groups below, post it here.
  1305.  
  1306. news.answers        Repository for periodic USENET articles. (Moderated)
  1307.             This article is crossposted there.
  1308.             Do not try to post here unless you're
  1309.             posting a list of FAQ's and their answers.
  1310.  
  1311. comp.unix.shell         Using and programming any UNIX shell.
  1312.  
  1313. comp.lang.c             Discussion about C.
  1314.  
  1315. comp.sources.unix       Postings of complete, UNIX-oriented sources. (Moderated)
  1316. comp.std.unix           Discussion for the P1003 committee on UNIX. (Moderated)
  1317. comp.unix               Discussion of UNIX* features and bugs. (Moderated)
  1318. comp.unix.admin         Administering a Unix-based system.
  1319. comp.unix.aix           IBM's version of UNIX.
  1320. comp.unix.amiga        Unix on the Commodore Amiga
  1321. comp.unix.aux           The version of UNIX for Apple Macintosh II computers.
  1322. comp.unix.bsd           Discussions relating to BSD UNIX.
  1323. comp.unix.internals     Discussions on hacking UNIX internals.
  1324. comp.unix.large         UNIX on mainframes and in large networks.
  1325. comp.unix.misc          Various topics that don't fit other groups.
  1326. comp.unix.msdos         MS-DOS running under UNIX by whatever means.
  1327. comp.unix.programmer    Q&A for people programming under Unix.
  1328. comp.unix.sysv286       UNIX System V (not XENIX) on the '286.
  1329. comp.unix.sysv386       Versions of Unix (not Xenix) on Intel 80386-based boxes.
  1330. comp.unix.ultrix        Discussions about DEC's Ultrix.
  1331. comp.unix.xenix.misc    General discussions regarding XENIX (except SCO).
  1332. comp.unix.xenix.sco     XENIX versions from the Santa Cruz Operation.
  1333.  
  1334. comp.unix.wizards       In-depth discussions of advanced unix topics.
  1335.             People should not post to this group unless they
  1336.             have used unix as a user, sysadmin and know details
  1337.             of the kernel, and how different unix kernels differ.
  1338.             In other words, don't post to comp.unix.wizards.
  1339.  
  1340.           What Information Should I Include?
  1341.  
  1342. It's hard to include too much information.  There are hundreds of
  1343. different Unix systems out there, and they all have less in common
  1344. than you might think.  If you have a problem and are posting an
  1345. article, please be sure to mention:
  1346.  
  1347.     o A descriptive subject line.  Many people will decide whether
  1348.       to read your article solely on the basis of the subject line,
  1349.       so it should be a good statement of your problem.
  1350.  
  1351.       NOT GOOD                          GOOD
  1352.  
  1353.       "Help"                            "How do I sort a file by line length?"
  1354.       "Csh question"            "csh dumps core when I use '$<'"
  1355.  
  1356.     o What computer you are using, and what specific version
  1357.       of the operating system it uses.  For instance,
  1358.  
  1359.         SunOS 4.0.1, Sun 3/50
  1360.         4.3BSD-tahoe, Vax 11/780
  1361.         SVR3.2, 3b2
  1362.  
  1363.     o If possible, the *exact* text of any error message you
  1364.       may have encountered.
  1365.  
  1366.       WRONG                RIGHT
  1367.  
  1368.       "I can't print this file"     "When I type 'lpr Filename', I get
  1369.                       lpr: Filename: File too ugly to print
  1370.                      What does this mean?  It isn't in
  1371.                      the man page.  This is using
  1372.                      Mueslix 9.3 on a Fax 68086502"
  1373.  
  1374. It's a good idea to post unrelated questions in separate articles,
  1375. so that people can keep different discussions separate.   It's also
  1376. a *very* good idea to include a line or two like this:
  1377.  
  1378.     "Please mail your answers to me and I'll summarize what I get
  1379.      and post the results to comp.unix.questions."
  1380.  
  1381. This prevents many identical responses from different users to the
  1382. same question from clogging up the newsgroup.  And make sure
  1383. you really summarize what you get - don't just concatenate
  1384. all the mail you've received.
  1385.  
  1386. It's also a good idea to read comp.unix.questions for at least a couple
  1387. of weeks after you post your article to see what followup articles
  1388. are posted.
  1389.  
  1390.                 Should I Post an Answer to a Question?
  1391.  
  1392. It's very tempting to post an answer to a question you read on the net,
  1393. especially when you think "Aha, finally - a question I can answer!"
  1394. Consider though that when a simple question is asked, such as the
  1395. sort about to be answered below, many other people around the
  1396. world already know the answer and may be posting their own reply.
  1397. In order to avoid dozens of replies to simple questions, please
  1398. wait a day or so and see if anyone else has already answered
  1399. the question.  If you have something special to contribute, please
  1400. do so, but make sure you're not duplicating something someone else has
  1401. already done.
  1402.  
  1403. You should feel free to reply to any question >by email<.  Even if
  1404. the user gets 200 responses to his question, at least the load on the
  1405. rest of the net is minimized.
  1406.  
  1407.                     What About Posting Source Code?
  1408.  
  1409. Posting small amounts of example code is fine (use comp.sources.unix to
  1410. distribute complete programs) - but please make sure that your code
  1411. runs (or at least compiles) properly.  Don't just type it in while
  1412. editing your posting and hope it will work, no matter how sure you are
  1413. that it will.  We all make mistakes.
  1414.  
  1415.                         What About Those People
  1416.        Who Continue to Ask Stupid or Frequently Asked Questions
  1417.          In Spite of The Frequently Asked Questions Document?
  1418.  
  1419. Just send them a polite mail message, possibly referring them to this document.
  1420. There is no need to flame them on the net - it's busy enough as it is.
  1421. -- 
  1422. Ted Timar - tmatimar@empress.com
  1423. Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3
  1424.  
  1425. -----------------------------
  1426.  
  1427. From: Ted M A Timar <tmatimar@empress.com>
  1428. Subject: Frequently Asked Questions about Unix (index) [Biweekly posting]
  1429. Date: 20 Nov 92 06:00:44 GMT
  1430. Expires: 18 Dec 1992 06:00:22 GMT
  1431. Followup-To: comp.unix.questions
  1432. Approved: news-answers-request@MIT.Edu
  1433. Supersedes: <unix-faq/contents_721029617@athena.mit.edu>
  1434. NNTP-Posting-Host: pit-manager.mit.edu
  1435. X-Last-Updated: 1992/10/21
  1436. To:       info-unix@sem.brl.mil
  1437.  
  1438. Archive-name: unix-faq/contents
  1439. Version: $Id: contents,v 2.0 92/10/20 12:06:12 tmatimar Exp $
  1440.  
  1441. The following seven articles contain the answers to some Frequently Asked
  1442. Questions often seen in comp.unix.questions and comp.unix.shell.
  1443. Please don't ask these questions again, they've been answered plenty
  1444. of times already - and please don't flame someone just because they may
  1445. not have read this particular posting.  Thank you.
  1446.  
  1447. These articles are divided approximately as follows:
  1448.  
  1449.       1.*) General questions.
  1450.       2.*) Relatively basic questions, likely to be asked by beginners.
  1451.       3.*) Intermediate questions.
  1452.       4.*) Advanced questions, likely to be asked by people who thought
  1453.        they already knew all of the answers.
  1454.       5.*) Questions pertaining to the various shells, and the differences.
  1455.       6.*) An overview of Unix variants.
  1456.  
  1457. The following questions are answered:
  1458.  
  1459.       1.1)  Who helped you put this list together?
  1460.       1.2)  When someone refers to 'rn(1)' or 'ctime(3)', what does
  1461.               the number in parentheses mean?
  1462.       1.3)  What does {some strange unix command name} stand for?
  1463.       1.4)  How does the gateway between "comp.unix.questions" and the
  1464.               "info-unix" mailing list work?
  1465.       1.5)  What are some useful Unix or C books?
  1466.       1.6)  What happened to the pronunciation list that used to be
  1467.               part of this document?
  1468.  
  1469.       2.1)  How do I remove a file whose name begins with a "-" ?
  1470.       2.2)  How do I remove a file with funny characters in the filename ?
  1471.       2.3)  How do I get a recursive directory listing?
  1472.       2.4)  How do I get the current directory into my prompt?
  1473.       2.5)  How do I read characters from the terminal in a shell script?
  1474.       2.6)  How do I rename "*.foo" to "*.bar", or change file names
  1475.               to lowercase?
  1476.       2.7)  Why do I get [some strange error message] when I
  1477.               "rsh host command" ?
  1478.       2.8)  How do I {set an environment variable, change directory} inside a
  1479.               program or shell script and have that change affect my
  1480.               current shell?
  1481.       2.9)  How do I redirect stdout and stderr separately in csh?
  1482.       2.10) How do I tell inside .cshrc if I'm a login shell?
  1483.       2.11) How do I construct a shell glob-pattern that matches all files
  1484.             except "." and ".." ?
  1485.       2.12) How do I find the last argument in a Bourne shell script?
  1486.       2.13) What's wrong with having '.' in your $PATH ?
  1487.  
  1488.       3.1)  How do I find out the creation time of a file?
  1489.       3.2)  How do I use "rsh" without having the rsh hang around
  1490.               until the remote command has completed?
  1491.       3.3)  How do I truncate a file?
  1492.       3.4)  Why doesn't find's "{}" symbol do what I want?
  1493.       3.5)  How do I set the permissions on a symbolic link?
  1494.       3.6)  How do I "undelete" a file?
  1495.       3.7)  How can a process detect if it's running in the background?
  1496.       3.8)  Why doesn't redirecting a loop work as intended?  (Bourne shell)
  1497.       3.9)  How do I run 'passwd', 'ftp', 'telnet', 'tip' and other interactive
  1498.               programs from a shell script or in the background?
  1499.       3.10) How do I find out the process ID of a program with a particular
  1500.             name from inside a shell script or C program?
  1501.       3.11) How do I check the exit status of a remote command
  1502.             executed via "rsh" ?
  1503.       3.12) Is it possible to pass shell variable settings into an awk program?
  1504.       3.13) How do I get rid of zombie processes that persevere?
  1505.       3.14) How do I get lines from a pipe as they are written instead of
  1506.             only in larger blocks.
  1507.  
  1508.       4.1)  How do I read characters from a terminal without requiring the user
  1509.               to hit RETURN?
  1510.       4.2)  How do I check to see if there are characters to be read without
  1511.               actually reading?
  1512.       4.3)  How do I find the name of an open file?
  1513.       4.4)  How can an executing program determine its own pathname?
  1514.       4.5)  How do I use popen() to open a process for reading AND writing?
  1515.       4.6)  How do I sleep() in a C program for less than one second?
  1516.       4.7)  How can I get setuid shell scripts to work?
  1517.       4.8)  How can I find out which user or process has a file open or is using
  1518.             a particular file system (so that I can unmount it?)
  1519.       4.9)  How do I keep track of people who are fingering me?
  1520.       4.10) Is it possible to reconnect a process to a terminal after it has
  1521.             been disconnected, e.g. after starting a program in the background
  1522.             and logging out?
  1523.       4.11) Is it possible to "spy" on a terminal, displaying the output
  1524.             that's appearing on it on another terminal?
  1525.  
  1526.       5.1)  Can shells be classified into categories?
  1527.       5.2)  How do I "include" one shell script from within another
  1528.             shell script?
  1529.       5.3)  Do all shells have aliases?  Is there something else that
  1530.             can be used?
  1531.       5.4)  How are shell variables assigned?
  1532.       5.5)  How can I tell if I am running an interactive shell?
  1533.       5.6)  What "dot" files do the various shells use?
  1534.       5.7)  I would like to know more about the differences between the
  1535.             various shells.  Is this information available some place?
  1536.  
  1537.       6.1)  Disclaimer and introduction.
  1538.       6.2)  A very brief look at Unix history.
  1539.       6.3)  Main Unix flavors.
  1540.       6.4)  Unix Standards.
  1541.       6.5)  Identifying your Unix flavor.
  1542.       6.6)  Brief notes on some well-known (commercial/PD) Unices.
  1543.       6.7)  Real-time Unices.
  1544.       6.8)  Unix glossary.
  1545.       6.9)  Acknowledgements.
  1546.  
  1547.       7.1)  RCS vs SCCS:  Introduction
  1548.       7.2)  RCS vs SCCS:  How do the interfaces compare?
  1549.       7.3)  RCS vs SCCS:  What's in a Revision File?
  1550.       7.4)  RCS vs SCCS:  What are the keywords?
  1551.       7.5)  What's an RCS symbolic name?
  1552.       7.6)  RCS vs SCCS:  How do they compare for performance?
  1553.       7.7)  RCS vs SCCS:  Version Identification.
  1554.       7.8)  RCS vs SCCS:  How do they handle with problems?
  1555.       7.9)  RCS vs SCCS:  Conversion.
  1556.       7.10) RCS vs SCCS:  Support
  1557.       7.11) RCS vs SCCS:  Command Comparison
  1558.       7.12) RCS vs SCCS:  Acknowledgements
  1559.       7.13) Can I get more information on configuration management systems?
  1560.  
  1561.       If you're looking for the answer to, say, question 2.5, look in
  1562.       part 2 and search for the regular expression "^2.5)".
  1563.  
  1564. While these are all legitimate questions, they seem to crop up in
  1565. comp.unix.questions or comp.unix.shell on an annual basis, usually
  1566. followed by plenty of replies (only some of which are correct) and then
  1567. a period of griping about how the same questions keep coming up.  You
  1568. may also like to read the monthly article "Answers to Frequently Asked
  1569. Questions" in the newsgroup "news.announce.newusers", which will tell
  1570. you what "UNIX" stands for.
  1571.  
  1572. With the variety of Unix systems in the world, it's hard to guarantee
  1573. that these answers will work everywhere.  Read your local manual pages
  1574. before trying anything suggested here.  If you have suggestions or
  1575. corrections for any of these answers, please send them to to
  1576. tmatimar@empress.com.
  1577.  
  1578. -- 
  1579. Ted Timar - tmatimar@empress.com
  1580. Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3
  1581.  
  1582. -----------------------------
  1583.  
  1584. From: Ted M A Timar <tmatimar@empress.com>
  1585. Subject: Frequently Asked Questions about Unix (1/7) [Biweekly posting]
  1586. Date: 20 Nov 92 06:00:45 GMT
  1587. Expires: 18 Dec 1992 06:00:22 GMT
  1588. Followup-To: comp.unix.questions
  1589. Approved: news-answers-request@MIT.Edu
  1590. Supersedes: <unix-faq/part1_721029617@athena.mit.edu>
  1591. NNTP-Posting-Host: pit-manager.mit.edu
  1592. X-Last-Updated: 1992/10/21
  1593. To:       info-unix@sem.brl.mil
  1594.  
  1595. Archive-name: unix-faq/part1
  1596. Version: $Id: part1,v 2.0 92/10/20 12:06:59 tmatimar Exp $
  1597.  
  1598. These seven articles contain the answers to some Frequently Asked
  1599. Questions often seen in comp.unix.questions and comp.unix.shell.
  1600. Please don't ask these questions again, they've been answered plenty
  1601. of times already - and please don't flame someone just because they may
  1602. not have read this particular posting.  Thank you.
  1603.  
  1604. These articles are divided approximately as follows:
  1605.  
  1606.       1.*) General questions.
  1607.       2.*) Relatively basic questions, likely to be asked by beginners.
  1608.       3.*) Intermediate questions.
  1609.       4.*) Advanced questions, likely to be asked by people who thought
  1610.        they already knew all of the answers.
  1611.       5.*) Questions pertaining to the various shells, and the differences.
  1612.       6.*) An overview of Unix variants.
  1613.       7.*) An comparison of configuration management systems (RCS, SCCS).
  1614.  
  1615. This article includes answers to:
  1616.  
  1617.       1.1)  Who helped you put this list together?
  1618.       1.2)  When someone refers to 'rn(1)' or 'ctime(3)', what does
  1619.               the number in parentheses mean?
  1620.       1.3)  What does {some strange unix command name} stand for?
  1621.       1.4)  How does the gateway between "comp.unix.questions" and the
  1622.               "info-unix" mailing list work?
  1623.       1.5)  What are some useful Unix or C books?
  1624.       1.6)  What happened to the pronunciation list that used to be
  1625.               part of this document?
  1626.  
  1627. If you're looking for the answer to, say, question 1.5, and want to skip
  1628. everything else, you can search ahead for the regular expression "^1.5)".
  1629.  
  1630. While these are all legitimate questions, they seem to crop up in
  1631. comp.unix.questions or comp.unix.shell on an annual basis, usually
  1632. followed by plenty of replies (only some of which are correct) and then
  1633. a period of griping about how the same questions keep coming up.  You
  1634. may also like to read the monthly article "Answers to Frequently Asked
  1635. Questions" in the newsgroup "news.announce.newusers", which will tell
  1636. you what "UNIX" stands for.
  1637.  
  1638. With the variety of Unix systems in the world, it's hard to guarantee
  1639. that these answers will work everywhere.  Read your local manual pages
  1640. before trying anything suggested here.  If you have suggestions or
  1641. corrections for any of these answers, please send them to to
  1642. tmatimar@empress.com.
  1643.  
  1644. 1.1)  Who helped you put this list together?
  1645.  
  1646.       I took over the maintenance of this list.  Almost all of the work
  1647.       (and the credit) for generating this compilation was done by
  1648.       Steve Hayman.
  1649.  
  1650.       We also owe a great deal of thanks to dozens of Usenet readers who
  1651.       submitted questions, answers, corrections and suggestions for this
  1652.       list.  Special thanks go to Maarten Litmaath, Guy Harris and
  1653.       Jonathan Kamens, who have all made many especially valuable
  1654.       contributions.
  1655.  
  1656.       Part 5 of this document (shells) was written almost entirely by
  1657.       Matthew Wicks <wicks@dcdmjw.fnal.gov>.
  1658.  
  1659.       Part 6 of this document (Unix flavours) was written almost entirely by
  1660.       Pierre (P.) Lewis <lew@bnr.ca>.
  1661.  
  1662.       Where possible the author of each question and the date it was last
  1663.       updated is given at the top.  Unfortunately, I only started this
  1664.       practice recently, and much of the information is lost.  I was also
  1665.       negligent in keeping track of who provided updates to questions.
  1666.       Sorry to those who have made valuable contributions, but did not
  1667.       receive the credit and recognition that they legitimately deserve.
  1668.  
  1669. 1.2)  When someone refers to 'rn(1)' or 'ctime(3)', what does
  1670.       the number in parentheses mean?
  1671.  
  1672.       It looks like some sort of function call, but it isn't.  These
  1673.       numbers refer to the section of the "Unix manual" where the
  1674.       appropriate documentation can be found.  You could type "man 3
  1675.       ctime" to look up the manual page for "ctime" in section 3 of
  1676.       the manual.
  1677.  
  1678.       The traditional manual sections are:
  1679.  
  1680.     1    User-level  commands
  1681.     2    System calls
  1682.     3    Library functions
  1683.     4    Devices and device drivers
  1684.     5    File formats
  1685.     6    Games
  1686.     7    Various miscellaneous stuff - macro packages etc.
  1687.     8    System maintenance and operation commands
  1688.  
  1689.       Some Unix versions use non-numeric section names.  For instance,
  1690.       Xenix uses "C" for commands and "S" for functions.
  1691.  
  1692.       Each section has an introduction, which you can read with "man #
  1693.       intro" where # is the section number.
  1694.  
  1695.       Sometimes the number is necessary to differentiate between a
  1696.       command and a library routine or system call of the same name.
  1697.       For instance, your system may have "time(1)", a manual page about
  1698.       the 'time' command for timing programs, and also "time(3)", a
  1699.       manual page about the 'time' subroutine for determining the
  1700.       current time.  You can use "man 1 time" or "man 3 time" to
  1701.       specify which "time" man page you're interested in.
  1702.  
  1703.       You'll often find other sections for local programs or even
  1704.       subsections of the sections above - Ultrix has sections 3m, 3n,
  1705.       3x and 3yp among others.
  1706.  
  1707. 1.3)  What does {some strange unix command name} stand for?
  1708.  
  1709.       awk = "Aho Weinberger and Kernighan"
  1710.  
  1711.     This language was named by its authors, Al Aho, Peter
  1712.     Weinberger and Brian Kernighan.
  1713.  
  1714.       grep = "Global Regular Expression Print"
  1715.  
  1716.     grep comes from the ed command to print all lines matching a
  1717.     certain pattern
  1718.  
  1719.             g/re/p
  1720.  
  1721.     where "re" is a "regular expression".
  1722.  
  1723.       fgrep = "Fixed GREP".
  1724.  
  1725.     fgrep searches for fixed strings only.  The "f" does not stand
  1726.     for "fast" - in fact, "fgrep foobar *.c" is usually slower than
  1727.     "egrep foobar *.c"  (Yes, this is kind of surprising. Try it.)
  1728.  
  1729.     Fgrep still has its uses though, and may be useful when searching
  1730.     a file for a larger number of strings than egrep can handle.
  1731.  
  1732.       egrep = "Extended GREP"
  1733.  
  1734.     egrep uses fancier regular expressions than grep.  Many people
  1735.     use egrep all the time, since it has some more sophisticated
  1736.     internal algorithms than grep or fgrep, and is usually the
  1737.     fastest of the three programs.
  1738.  
  1739.       cat = "CATenate"
  1740.  
  1741.     catenate is an obscure word meaning "to connect in a series",
  1742.     which is what the "cat" command does to one or more files.  Not
  1743.     to be confused with C/A/T, the Computer Aided Typesetter.
  1744.  
  1745.       gecos = "General Electric Comprehensive Operating System"
  1746.     
  1747.     When GE's large systems division was sold to Honeywell,
  1748.     Honeywell dropped the "E" from "GECOS".
  1749.  
  1750.     Unix's password file has a "pw_gecos" field.  The name is a
  1751.     real holdover from the early days.  Dennis Ritchie has reported:
  1752.  
  1753.         "Sometimes we sent printer output or batch jobs
  1754.          to the GCOS machine.  The gcos field in the password file
  1755.          was a place to stash the information for the $IDENT card.
  1756.          Not elegant."
  1757.  
  1758.       nroff = "New ROFF"
  1759.       troff = "Typesetter new ROFF"
  1760.     
  1761.     These are descendants of "roff", which was a re-implementation
  1762.     of the Multics "runoff" program (a program that you'd use to
  1763.     "run off" a good copy of a document).
  1764.  
  1765.       tee       = T
  1766.  
  1767.     From plumbing terminology for a T-shaped pipe splitter.
  1768.  
  1769.       bss = "Block Started by Symbol"
  1770.     
  1771.     Dennis Ritchie says:
  1772.  
  1773.         Actually the acronym (in the sense we took it up; it may
  1774.         have other credible etymologies) is "Block Started by
  1775.         Symbol." It was a pseudo-op in FAP (Fortran Assembly [-er?]
  1776.         Program), an assembler for the IBM 704-709-7090-7094
  1777.         machines.  It defined its label and set aside space for a
  1778.         given number of words.  There was another pseudo-op, BES,
  1779.         "Block Ended by Symbol" that did the same except that the
  1780.         label was defined by the last assigned word + 1.  (On these
  1781.         machines Fortran arrays were stored backwards in storage
  1782.         and were 1-origin.)
  1783.  
  1784.         The usage is reasonably appropriate, because just as with
  1785.         standard Unix loaders, the space assigned didn't have to be
  1786.         punched literally into the object deck but was represented
  1787.         by a count somewhere.
  1788.  
  1789.       biff = "BIFF"
  1790.  
  1791.     This command, which turns on asynchronous mail notification,
  1792.     was actually named after a dog at Berkeley.
  1793.  
  1794.         I can confirm the origin of biff, if you're interested.
  1795.         Biff was Heidi Stettner's dog, back when Heidi (and I, and
  1796.         Bill Joy) were all grad students at U.C. Berkeley and the
  1797.         early versions of BSD were being developed.   Biff was
  1798.         popular among the residents of Evans Hall, and was known
  1799.         for barking at the mailman, hence the name of the command.
  1800.  
  1801.     Confirmation courtesy of Eric Cooper, Carnegie Mellon University
  1802.  
  1803.       rc (as in ".cshrc" or "/etc/rc") = "RunCom"
  1804.  
  1805.     "rc" derives from "runcom", from the MIT CTSS system, ca. 1965.
  1806.  
  1807.         'There was a facility that would execute a bunch of
  1808.         commands stored in a file; it was called "runcom" for "run
  1809.         commands", and the file began to be called "a runcom."
  1810.  
  1811.         "rc" in Unix is a fossil from that usage.'
  1812.     
  1813.     Brian Kernighan & Dennis Ritchie, as told to Vicki Brown
  1814.  
  1815.     "rc" is also the name of the shell from the new Plan 9
  1816.     operating system.
  1817.  
  1818.       Perl = "Practical Extraction and Report Language"
  1819.  
  1820.     The Perl language is Larry Wall's highly popular
  1821.     freely-available completely portable text, process, and file
  1822.     manipulation tool that bridges the gap between shell and C
  1823.     programming (or between doing it on the command line and
  1824.     pulling your hair out).  For further information, see the
  1825.     Usenet newsgroup comp.lang.perl.
  1826.  
  1827.       Don Libes' book "Life with Unix" contains lots more of these
  1828.       tidbits.
  1829.  
  1830. 1.4)  How does the gateway between "comp.unix.questions" and the
  1831.       "info-unix" mailing list work?
  1832.  
  1833.       "info-unix" and "unix-qizards" are mailing list versions of
  1834.       comp.unix.questions and comp.unix.wizards respectively.
  1835.       There should be no difference in content between the
  1836.       mailing list and the newsgroup.
  1837.  
  1838.       To get on or off either of these lists, send mail to
  1839.       info-unix-request@brl.mil or unix-wizards-request@brl.mil.
  1840.       Be sure to use the '-Request'.  Don't expect an immediate response.
  1841.  
  1842.       Here are the gory details, courtesy of the list's maintainer,
  1843.       Bob Reschly.
  1844.  
  1845.       ==== postings to info-UNIX and UNIX-wizards lists ====
  1846.  
  1847.       Anything submitted to the list is posted; I do not moderate
  1848.       incoming traffic -- BRL functions as a reflector.  Postings
  1849.       submitted by Internet subscribers should be addressed to the list
  1850.       address (info-UNIX or UNIX- wizards);  the '-request' addresses
  1851.       are for correspondence with the list maintainer [me].  Postings
  1852.       submitted by USENET readers should be addressed to the
  1853.       appropriate news group (comp.unix.questions or
  1854.       comp.unix.wizards).
  1855.  
  1856.       For Internet subscribers, received traffic will be of two types;
  1857.       individual messages, and digests.  Traffic which comes to BRL
  1858.       from the Internet and BITNET (via the BITNET-Internet gateway) is
  1859.       immediately resent to all addressees on the mailing list.
  1860.       Traffic originating on USENET is gathered up into digests which
  1861.       are sent to all list members daily.
  1862.  
  1863.       BITNET traffic is much like Internet traffic.  The main
  1864.       difference is that I maintain only one address for traffic
  1865.       destined to all BITNET subscribers. That address points to a list
  1866.       exploder which then sends copies to individual BITNET
  1867.       subscribers.  This way only one copy of a given message has to
  1868.       cross the BITNET-Internet gateway in either direction.
  1869.  
  1870.       USENET subscribers see only individual messages.  All messages
  1871.       originating on the Internet side are forwarded to our USENET
  1872.       machine.  They are then posted to the appropriate newsgroup.
  1873.       Unfortunately, for gatewayed messages, the sender becomes
  1874.       "news@brl-adm".  This is currently an unavoidable side-effect of
  1875.       the software which performs the gateway function.
  1876.  
  1877.       As for readership, USENET has an extremely large readership - I
  1878.       would guess several thousand hosts and tens of thousands of
  1879.       readers.  The master list maintained here at BRL runs about two
  1880.       hundred fifty entries with roughly ten percent of those being
  1881.       local redistribution lists.  I don't have a good feel for the
  1882.       size of the BITNET redistribution, but I would guess it is
  1883.       roughly the same size and composition as the master list.
  1884.       Traffic runs 150K to 400K bytes per list per week on average.
  1885.  
  1886. 1.5)  What are some useful Unix or C books?
  1887.  
  1888.       Mitch Wright (mitch@cirrus.com) maintains a useful list of Unix
  1889.       and C books, with descriptions and some mini-reviews.  There are
  1890.       currently 77 titles on his list.
  1891.  
  1892.       You can obtain a copy of this list by anonymous ftp from
  1893.       ftp.wg.omron.co.jp (133.210.4.4), where it's
  1894.       "pub/unix-faq/docs/Unix-C-Booklist".  If you can't use anonymous
  1895.       ftp, email the line "help" to "mailserv@iuvax.cs.indiana.edu" for
  1896.       instructions on retrieving things via email.
  1897.  
  1898.       Send additions or suggestions to mitch@cirrus.com.
  1899.  
  1900. 1.6)  What happened to the pronunciation list that used to be part of this
  1901.       document?
  1902.  
  1903.       From its inception in 1989, this FAQ document included a
  1904.       comprehensive pronunciation list maintained by Maarten Litmaath
  1905.       (thanks, Maarten!).  (Does anyone know who *created* it?)
  1906.  
  1907.       It has been retired, since it is not really relevant to the topic
  1908.       of "Unix questions".  You can still find it as part of the
  1909.       widely-distributed "Jargon" file (maintained by Eric S. Raymond,
  1910.       eric@snark.thyrsus.com) which seems like a much more appropriate
  1911.       forum for the topic of "How do you pronounce  /* ?"
  1912.  
  1913.       If you'd like a copy, you can ftp one from ftp.wg.omron.co.jp
  1914.       (133.210.4.4), it's "pub/unix-faq/docs/Pronunciation-Guide".
  1915.  
  1916. -- 
  1917. Ted Timar - tmatimar@empress.com
  1918. Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3
  1919.  
  1920. -----------------------------
  1921.  
  1922. From: Ted M A Timar <tmatimar@empress.com>
  1923. Subject: Frequently Asked Questions about Unix (2/7) [Biweekly posting]
  1924. Date: 20 Nov 92 06:00:47 GMT
  1925. Expires: 18 Dec 1992 06:00:22 GMT
  1926. Followup-To: comp.unix.questions
  1927. Approved: news-answers-request@MIT.Edu
  1928. Supersedes: <unix-faq/part2_721029617@athena.mit.edu>
  1929. NNTP-Posting-Host: pit-manager.mit.edu
  1930. X-Last-Updated: 1992/10/21
  1931. To:       info-unix@sem.brl.mil
  1932.  
  1933. Archive-name: unix-faq/part2
  1934. Version: $Id: part2,v 2.0 92/10/20 12:07:03 tmatimar Exp $
  1935.  
  1936. These seven articles contain the answers to some Frequently Asked
  1937. Questions often seen in comp.unix.questions and comp.unix.shell.
  1938. Please don't ask these questions again, they've been answered plenty
  1939. of times already - and please don't flame someone just because they may
  1940. not have read this particular posting.  Thank you.
  1941.  
  1942. These articles are divided approximately as follows:
  1943.  
  1944.       1.*) General questions.
  1945.       2.*) Relatively basic questions, likely to be asked by beginners.
  1946.       3.*) Intermediate questions.
  1947.       4.*) Advanced questions, likely to be asked by people who thought
  1948.        they already knew all of the answers.
  1949.       5.*) Questions pertaining to the various shells, and the differences.
  1950.       6.*) An overview of Unix variants.
  1951.       7.*) An comparison of configuration management systems (RCS, SCCS).
  1952.  
  1953. This article includes answers to:
  1954.  
  1955.       2.1)  How do I remove a file whose name begins with a "-" ?
  1956.       2.2)  How do I remove a file with funny characters in the filename ?
  1957.       2.3)  How do I get a recursive directory listing?
  1958.       2.4)  How do I get the current directory into my prompt?
  1959.       2.5)  How do I read characters from the terminal in a shell script?
  1960.       2.6)  How do I rename "*.foo" to "*.bar", or change file names
  1961.               to lowercase?
  1962.       2.7)  Why do I get [some strange error message] when I
  1963.               "rsh host command" ?
  1964.       2.8)  How do I {set an environment variable, change directory} inside a
  1965.               program or shell script and have that change affect my
  1966.               current shell?
  1967.       2.9)  How do I redirect stdout and stderr separately in csh?
  1968.       2.10) How do I tell inside .cshrc if I'm a login shell?
  1969.       2.11) How do I construct a shell glob-pattern that matches all files
  1970.             except "." and ".." ?
  1971.       2.12) How do I find the last argument in a Bourne shell script?
  1972.       2.13) What's wrong with having '.' in your $PATH ?
  1973.  
  1974. If you're looking for the answer to, say, question 2.5, and want to skip
  1975. everything else, you can search ahead for the regular expression "^2.5)".
  1976.  
  1977. While these are all legitimate questions, they seem to crop up in
  1978. comp.unix.questions or comp.unix.shell on an annual basis, usually
  1979. followed by plenty of replies (only some of which are correct) and then
  1980. a period of griping about how the same questions keep coming up.  You
  1981. may also like to read the monthly article "Answers to Frequently Asked
  1982. Questions" in the newsgroup "news.announce.newusers", which will tell
  1983. you what "UNIX" stands for.
  1984.  
  1985. With the variety of Unix systems in the world, it's hard to guarantee
  1986. that these answers will work everywhere.  Read your local manual pages
  1987. before trying anything suggested here.  If you have suggestions or
  1988. corrections for any of these answers, please send them to to
  1989. tmatimar@empress.com.
  1990.  
  1991. 2.1)  How do I remove a file whose name begins with a "-" ?
  1992.  
  1993.       Figure out some way to name the file so that it doesn't begin
  1994.       with a dash.  The simplest answer is to use
  1995.  
  1996.         rm ./-filename
  1997.  
  1998.       (assuming "-filename" is in the current directory, of course.)
  1999.       This method of avoiding the interpretation of the "-" works with
  2000.       other commands too.
  2001.  
  2002.       Many commands, particularly those that have been written to use
  2003.       the "getopt(3)" argument parsing routine, accept a "--" argument
  2004.       which means "this is the last option, anything after this is not
  2005.       an option", so your version of rm might handle "rm -- -filename".
  2006.       Some versions of rm that don't use getopt() treat a single "-"
  2007.       in the same way, so you can also try "rm - -filename".
  2008.  
  2009. 2.2)  How do I remove a file with funny characters in the filename ?
  2010.  
  2011.       If the 'funny character' is a '/', skip to the last part of this
  2012.       answer.  If the funny character is something else, such as a ' '
  2013.       or control character or character with the 8th bit set, keep reading.
  2014.  
  2015.       The classic answers are
  2016.  
  2017.     rm -i some*pattern*that*matches*only*the*file*you*want
  2018.  
  2019.     which asks you whether you want to remove each file matching
  2020.     the indicated pattern;  depending on your shell, this may not
  2021.     work if the filename has a character with the 8th bit set (the
  2022.     shell may strip that off);
  2023.  
  2024.       and
  2025.  
  2026.     rm -ri .
  2027.  
  2028.     which asks you whether to remove each file in the directory.
  2029.     Answer "y" to the problem file and "n" to everything else.
  2030.     Unfortunately this doesn't work with many versions of rm.  Also
  2031.     unfortunately, this will walk through every subdirectory of ".",
  2032.     so you might want to "chmod a-x" those directories temporarily
  2033.     to make them unsearchable.
  2034.  
  2035.     Always take a deep breath and think about what you're doing and
  2036.     double check what you typed when you use rm's "-r" flag or a
  2037.     wildcard on the command line;
  2038.  
  2039.       and
  2040.  
  2041.     find . -type f ... -ok rm '{}' \;
  2042.  
  2043.       where "..." is a group of predicates that uniquely identify the
  2044.       file.  One possibility is to figure out the inode number of the
  2045.       problem file (use "ls -i .") and then use
  2046.  
  2047.     find . -inum 12345 -ok rm '{}' \;
  2048.  
  2049.       or
  2050.     find . -inum 12345 -ok mv '{}' new-file-name \;
  2051.     
  2052.       "-ok" is a safety check - it will prompt you for confirmation of
  2053.       the command it's about to execute.  You can use "-exec" instead
  2054.       to avoid the prompting, if you want to live dangerously, or if
  2055.       you suspect that the filename may contain a funny character
  2056.       sequence that will mess up your screen when printed.
  2057.  
  2058.       What if the filename has a '/' in it?
  2059.  
  2060.       These files really are special cases, and can only be created by
  2061.       buggy kernel code (typically by implementations of NFS that don't
  2062.       filter out illegal characters in file names from remote
  2063.       machines.)  The first thing to do is to try to understand exactly
  2064.       why this problem is so strange.
  2065.  
  2066.       Recall that Unix directories are simply pairs of filenames and
  2067.       inode numbers.  A directory essentially contains information
  2068.       like this:
  2069.  
  2070.     filename  inode
  2071.  
  2072.     file1      12345
  2073.     file2.c      12349
  2074.     file3     12347
  2075.  
  2076.       Theoretically, '/' and '\0' are the only two characters that
  2077.       cannot appear in a filename - '/' because it's used to separate
  2078.       directories and files, and '\0' because it terminates a filename.
  2079.  
  2080.       Unfortunately some implementations of NFS will blithely create
  2081.       filenames with embedded slashes in response to requests from
  2082.       remote machines.  For instance, this could happen when someone on
  2083.       a Mac or other non-Unix machine decides to create a remote NFS
  2084.       file on your Unix machine with the date in the filename.  Your
  2085.       Unix directory then has this in it:
  2086.  
  2087.     filename  inode
  2088.  
  2089.     91/02/07  12357
  2090.  
  2091.       No amount of messing around with 'find' or 'rm' as described
  2092.       above will delete this file, since those utilities and all other
  2093.       Unix programs, are forced to interpret the '/' in the normal way.
  2094.  
  2095.       Any ordinary program will eventually try to do
  2096.       unlink("91/02/07"), which as far as the kernel is concerned means
  2097.       "unlink the file 07 in the subdirectory 02 of directory 91", but
  2098.       that's not what we have - we have a *FILE* named "91/02/07" in
  2099.       the current directory.  This is a subtle but crucial distinction.
  2100.  
  2101.       What can you do in this case?  The first thing to try is to
  2102.       return to the Mac that created this crummy entry, and see if you
  2103.       can convince it and your local NFS daemon to rename the file to
  2104.       something without slashes.
  2105.  
  2106.       If that doesn't work or isn't possible, you'll need help from
  2107.       your system manager, who will have to try the one of the
  2108.       following.  Use "ls -i" to find the inode number of this bogus
  2109.       file, then unmount the file system and use "clri" to clear the
  2110.       inode, and "fsck" the file system with your fingers crossed.
  2111.       This destroys the information in the file.  If you want to keep
  2112.       it, you can try:
  2113.  
  2114.     create a new directory in the same parent directory as the one
  2115.     containing the bad file name;
  2116.  
  2117.     move everything you can (i.e. everything but the file with the
  2118.     bad name) from the old directory to the new one;
  2119.  
  2120.     do "ls -id" on the directory containing the file with the bad
  2121.     name to get its inumber;
  2122.  
  2123.     umount the file system;
  2124.  
  2125.     "clri" the directory containing the file with the bad name;
  2126.  
  2127.     "fsck" the file system.
  2128.  
  2129.       Then, to find the file,
  2130.  
  2131.     remount the file system;
  2132.  
  2133.     rename the directory you created to have the name of the old
  2134.     directory (since the old directory should have been blown away
  2135.     by "fsck")
  2136.  
  2137.     move the file out of "lost+found" into the directory with a
  2138.     better name.
  2139.  
  2140.       Alternatively, you can patch the directory the hard way by
  2141.       crawling around in the raw file system.  Use "fsdb", if you
  2142.       have it.
  2143.  
  2144. 2.3)  How do I get a recursive directory listing?
  2145.  
  2146.       One of the following may do what you want:
  2147.  
  2148.     ls -R             (not all versions of "ls" have -R)
  2149.     find . -print        (should work everywhere)
  2150.     du -a .            (shows you both the name and size)
  2151.  
  2152.       If you're looking for a wildcard pattern that will match all ".c"
  2153.       files in this directory and below, you won't find one, but you
  2154.       can use
  2155.  
  2156.     % some-command `find . -name '*.c' -print`
  2157.  
  2158.       "find" is a powerful program.  Learn about it.
  2159.  
  2160. 2.4)  How do I get the current directory into my prompt?
  2161.  
  2162.       It depends which shell you are using.  It's easy with some
  2163.       shells, hard or impossible with others.
  2164.  
  2165.       C Shell (csh):
  2166.     Put this in your .cshrc - customize the prompt variable the
  2167.     way you want.
  2168.  
  2169.         alias setprompt 'set prompt="${cwd}% "'
  2170.         setprompt        # to set the initial prompt
  2171.         alias cd 'chdir \!* && setprompt'
  2172.     
  2173.     If you use pushd and popd, you'll also need
  2174.  
  2175.         alias pushd 'pushd \!* && setprompt'
  2176.         alias popd  'popd  \!* && setprompt'
  2177.  
  2178.     Some C shells don't keep a $cwd variable - you can use
  2179.     `pwd` instead.
  2180.  
  2181.     If you just want the last component of the current directory
  2182.     in your prompt ("mail% " instead of "/usr/spool/mail% ")
  2183.     you can use
  2184.  
  2185.         alias setprompt 'set prompt="$cwd:t% "'
  2186.     
  2187.     Some older csh's get the meaning of && and || reversed.
  2188.     Try doing:
  2189.  
  2190.         false && echo bug
  2191.  
  2192.     If it prints "bug", you need to switch && and || (and get
  2193.     a better version of csh.)
  2194.  
  2195.       Bourne Shell (sh):
  2196.  
  2197.     If you have a newer version of the Bourne Shell (SVR2 or newer)
  2198.     you can use a shell function to make your own command, "xcd" say:
  2199.  
  2200.         xcd() { cd $* ; PS1="`pwd` $ "; }
  2201.  
  2202.     If you have an older Bourne shell, it's complicated but not
  2203.     impossible.  Here's one way.  Add this to your .profile file:
  2204.  
  2205.         LOGIN_SHELL=$$ export LOGIN_SHELL
  2206.         CMDFILE=/tmp/cd.$$ export CMDFILE
  2207.         # 16 is SIGURG, pick a signal that's not likely to be used
  2208.         PROMPTSIG=16 export PROMPTSIG
  2209.         trap '. $CMDFILE' $PROMPTSIG
  2210.  
  2211.     and then put this executable script (without the indentation!),
  2212.     let's call it "xcd", somewhere in your PATH
  2213.  
  2214.         : xcd directory - change directory and set prompt
  2215.         : by signalling the login shell to read a command file
  2216.         cat >${CMDFILE?"not set"} <<EOF
  2217.         cd $1
  2218.         PS1="\`pwd\`$ "
  2219.         EOF
  2220.         kill -${PROMPTSIG?"not set"} ${LOGIN_SHELL?"not set"}
  2221.  
  2222.     Now change directories with "xcd /some/dir".
  2223.  
  2224.       Korn Shell (ksh):
  2225.  
  2226.     Put this in your .profile file:
  2227.         PS1='$PWD $ '
  2228.     
  2229.     If you just want the last component of the directory, use
  2230.         PS1='${PWD##*/} $ '
  2231.  
  2232.       T C shell (tcsh)
  2233.  
  2234.     Tcsh is a popular enhanced version of csh with some extra
  2235.     builtin variables (and many other features):
  2236.  
  2237.         %~        the current directory, using ~ for $HOME
  2238.         %d or %/    the full pathname of the current directory
  2239.         %c or %.    the trailing component of the current directory
  2240.  
  2241.     so you can do
  2242.  
  2243.         set prompt='%~ '
  2244.  
  2245.       BASH (FSF's "Bourne Again SHell")
  2246.     
  2247.     \w in $PS1 gives the full pathname of the current directory,
  2248.     with ~ expansion for $HOME;  \W gives the basename of
  2249.     the current directory.  So, in addition to the above sh and
  2250.     ksh solutions, you could use
  2251.  
  2252.         PS1='\w $ '    
  2253.     or
  2254.         PS1='\W $ '
  2255.  
  2256. 2.5)  How do I read characters from the terminal in a shell script?
  2257.  
  2258.       In sh, use read.  It is most common to use a loop like
  2259.  
  2260.         while read line
  2261.         do
  2262.             ...
  2263.         done
  2264.  
  2265.       In csh, use $< like this:
  2266.     
  2267.         while ( 1 )
  2268.         set line = "$<"
  2269.         if ( "$line" == "" ) break
  2270.         ...
  2271.         end
  2272.  
  2273.       Unfortunately csh has no way of distinguishing between a blank
  2274.       line and an end-of-file.
  2275.  
  2276.       If you're using sh and want to read a *single* character from the
  2277.       terminal, you can try something like
  2278.  
  2279.         echo -n "Enter a character: "
  2280.         stty cbreak        # or  stty raw
  2281.         readchar=`dd if=/dev/tty bs=1 count=1 2>/dev/null`
  2282.         stty -cbreak
  2283.  
  2284.         echo "Thank you for typing a $readchar ."
  2285.  
  2286. 2.6)  How do I rename "*.foo" to "*.bar", or change file names to lowercase?
  2287.     
  2288.       Why doesn't "mv *.foo *.bar" work?  Think about how the shell
  2289.       expands wildcards.   "*.foo" and "*.bar" are expanded before the
  2290.       mv command ever sees the arguments.  Depending on your shell,
  2291.       this can fail in a couple of ways.  CSH prints "No match."
  2292.       because it can't match "*.bar".  SH executes "mv a.foo b.foo
  2293.       c.foo *.bar", which will only succeed if you happen to have a
  2294.       single directory named "*.bar", which is very unlikely and almost
  2295.       certainly not what you had in mind.
  2296.  
  2297.       Depending on your shell, you can do it with a loop to "mv" each
  2298.       file individually.  If your system has "basename", you can use:
  2299.  
  2300.       C Shell:
  2301.     foreach f ( *.foo )
  2302.         set base=`basename $f .foo`
  2303.         mv $f $base.bar
  2304.     end
  2305.  
  2306.       Bourne Shell:
  2307.     for f in *.foo; do
  2308.         base=`basename $f .foo`
  2309.         mv $f $base.bar
  2310.     done
  2311.  
  2312.       Some shells have their own variable substitution features, so
  2313.       instead of using "basename", you can use simpler loops like:
  2314.  
  2315.       C Shell:
  2316.  
  2317.     foreach f ( *.foo )
  2318.         mv $f $f:r.bar
  2319.     end
  2320.  
  2321.       Korn Shell:
  2322.  
  2323.     for f in *.foo; do
  2324.         mv $f ${f%foo}bar
  2325.     done
  2326.  
  2327.       If you don't have "basename" or want to do something like
  2328.       renaming foo.* to bar.*, you can use something like "sed" to
  2329.       strip apart the original file name in other ways, but the general
  2330.       looping idea is the same.  You can also convert file names into
  2331.       "mv" commands with 'sed', and hand the commands off to "sh" for
  2332.       execution.  Try
  2333.  
  2334.     ls -d *.foo | sed -e 's/.*/mv & &/' -e 's/foo$/bar/' | sh
  2335.  
  2336.       A program by Vladimir Lanin called "mmv" that does this job
  2337.       nicely was posted to comp.sources.unix (Volume 21, issues 87 and
  2338.       88) in April 1990.  It lets you use
  2339.  
  2340.     mmv '*.foo' '=1.bar'
  2341.  
  2342.       Shell loops like the above can also be used to translate file
  2343.       names from upper to lower case or vice versa.  You could use
  2344.       something like this to rename uppercase files to lowercase:
  2345.  
  2346.     C Shell:
  2347.         foreach f ( * )
  2348.         mv $f `echo $f | tr '[A-Z]' '[a-z]'`
  2349.         end
  2350.     Bourne Shell:
  2351.         for f in *; do
  2352.         mv $f `echo $f | tr '[A-Z]' '[a-z]'`
  2353.         done
  2354.     Korn Shell:
  2355.         typeset -l l
  2356.         for f in *; do
  2357.         l="$f"
  2358.         mv $f $l
  2359.         done
  2360.  
  2361.       If you wanted to be really thorough and handle files with `funny'
  2362.       names (embedded blanks or whatever) you'd need to use
  2363.  
  2364.     Bourne Shell:
  2365.  
  2366.         for f in *; do
  2367.           g=`expr "xxx$f" : 'xxx\(.*\)' | tr '[A-Z]' '[a-z]'`
  2368.           mv "$f" "$g"
  2369.         done
  2370.  
  2371.       The `expr' command will always print the filename, even if it
  2372.       equals `-n' or if it contains a System V escape sequence like `\c'.
  2373.  
  2374.       Some versions of "tr" require the [ and ], some don't.  It
  2375.       happens to be harmless to include them in this particular
  2376.       example; versions of tr that don't want the [] will conveniently
  2377.       think they are supposed to translate '[' to '[' and ']' to ']'.
  2378.  
  2379.       If you have the "perl" language installed, you may find this
  2380.       rename script by Larry Wall very useful.  It can be used to
  2381.       accomplish a wide variety of filename changes.
  2382.  
  2383.     #!/usr/bin/perl
  2384.     #
  2385.     # rename script examples from lwall:
  2386.     #       rename 's/\.orig$//' *.orig
  2387.     #       rename 'y/A-Z/a-z/ unless /^Make/' *
  2388.     #       rename '$_ .= ".bad"' *.f
  2389.     #       rename 'print "$_: "; s/foo/bar/ if <stdin> =~ /^y/i' *
  2390.  
  2391.     $op = shift;
  2392.     for (@ARGV) {
  2393.         $was = $_;
  2394.         eval $op;
  2395.         die $@ if $@;
  2396.         rename($was,$_) unless $was eq $_;
  2397.     }
  2398.  
  2399. 2.7)  Why do I get [some strange error message] when I "rsh host command" ?
  2400.  
  2401.       (We're talking about the remote shell program "rsh" or sometimes
  2402.       "remsh" or "remote"; on some machines, there is a restricted shell
  2403.       called "rsh", which is a different thing.)
  2404.  
  2405.       If your remote account uses the C shell, the remote host will
  2406.       fire up a C shell to execute 'command' for you, and that shell
  2407.       will read your remote .cshrc file.  Perhaps your .cshrc contains
  2408.       a "stty", "biff" or some other command that isn't appropriate for
  2409.       a non-interactive shell.  The unexpected output or error message
  2410.       from these commands can screw up your rsh in odd ways.
  2411.  
  2412.       Here's an example.  Suppose you have
  2413.  
  2414.     stty erase ^H
  2415.     biff y
  2416.  
  2417.       in your .cshrc file.  You'll get some odd messages like this.
  2418.  
  2419.     % rsh some-machine date
  2420.     stty: : Can't assign requested address
  2421.     Where are you?
  2422.     Tue Oct  1 09:24:45 EST 1991
  2423.  
  2424.       You might also get similar errors when running certain "at" or
  2425.       "cron" jobs that also read your .cshrc file.
  2426.  
  2427.       Fortunately, the fix is simple.  There are, quite possibly, a
  2428.       whole *bunch* of operations in your ".cshrc" (e.g., "set
  2429.       history=N") that are simply not worth doing except in interactive
  2430.       shells.  What you do is surround them in your ".cshrc" with:
  2431.  
  2432.         if ( $?prompt ) then
  2433.             operations....
  2434.         endif
  2435.  
  2436.       and, since in a non-interactive shell "prompt" won't be set, the
  2437.       operations in question will only be done in interactive shells.
  2438.  
  2439.       You may also wish to move some commands to your .login file; if
  2440.       those commands only need to be done when a login session starts
  2441.       up (checking for new mail, unread news and so on) it's better to
  2442.       have them in the .login file.
  2443.  
  2444. 2.8)  How do I {set an environment variable, change directory} inside
  2445.       a program or shell script and have that change affect my
  2446.       current shell?
  2447.  
  2448.       In general, you can't, at least not without making special
  2449.       arrangements.  When a child process is created, it inherits a
  2450.       copy of its parent's variables (and current directory).  The
  2451.       child can change these values all it wants but the changes won't
  2452.       affect the parent shell, since the child is changing a copy of
  2453.       the original data.
  2454.  
  2455.       Some special arrangements are possible.  Your child process could
  2456.       write out the changed variables, if the parent was prepared to
  2457.       read the output and interpret it as commands to set its own
  2458.       variables.
  2459.  
  2460.       Also, shells can arrange to run other shell scripts in the
  2461.       context of the current shell, rather than in a child process, so
  2462.       that changes will affect the original shell.
  2463.  
  2464.       For instance, if you have a C shell script named "myscript":
  2465.  
  2466.     cd /very/long/path
  2467.     setenv PATH /something:/something-else
  2468.  
  2469.       or the equivalent Bourne or Korn shell script
  2470.  
  2471.     cd /very/long/path
  2472.     PATH=/something:/something-else export PATH
  2473.  
  2474.       and try to run "myscript" from your shell, your shell will fork
  2475.       and run the shell script in a subprocess.  The subprocess is also
  2476.       running the shell; when it sees the "cd" command it changes *its*
  2477.       current directory, and when it sees the "setenv" command it
  2478.       changes *its* environment, but neither has any effect on the
  2479.       current directory of the shell at which you're typing (your login
  2480.       shell, let's say).
  2481.  
  2482.       In order to get your login shell to execute the script (without
  2483.       forking) you have to use the "." command (for the Bourne or Korn
  2484.       shells) or the "source" command (for the C shell).  I.e. you type
  2485.  
  2486.     . myscript
  2487.  
  2488.       to the Bourne or Korn shells, or
  2489.  
  2490.     source myscript
  2491.  
  2492.       to the C shell.
  2493.  
  2494.       If all you are trying to do is change directory or set an
  2495.       environment variable, it will probably be simpler to use a C
  2496.       shell alias or Bourne/Korn shell function.  See the "how do I get
  2497.       the current directory into my prompt" section of this article for
  2498.       some examples.
  2499.  
  2500. 2.9)  How do I redirect stdout and stderr separately in csh?
  2501.  
  2502.       In csh, you can redirect stdout with ">", or stdout and stderr
  2503.       together with ">&" but there is no direct way to redirect stderr
  2504.       only.  The best you can do is
  2505.  
  2506.     ( command >stdout_file ) >&stderr_file
  2507.  
  2508.       which runs "command" in a subshell;  stdout is redirected inside
  2509.       the subshell to stdout_file, and both stdout and stderr from the
  2510.       subshell are redirected to stderr_file, but by this point stdout
  2511.       has already been redirected so only stderr actually winds up in
  2512.       stderr_file.
  2513.  
  2514.       Sometimes it's easier to let sh do the work for you.
  2515.  
  2516.     sh -c 'command >stdout_file 2>stderr_file'
  2517.  
  2518. 2.10) How do I tell inside .cshrc if I'm a login shell?
  2519.  
  2520.       When people ask this, they usually mean either
  2521.  
  2522.     How can I tell if it's an interactive shell?  or
  2523.     How can I tell if it's a top-level shell?
  2524.  
  2525.       You could perhaps determine if your shell truly is a login shell
  2526.       (i.e. is going to source ".login" after it is done with ".cshrc")
  2527.       by fooling around with "ps" and "$$".  Login shells generally
  2528.       have names that begin with a '-'.  If you're really interested in
  2529.       the other two questions, here's one way you can organize your
  2530.       .cshrc to find out.
  2531.  
  2532.     if (! $?CSHLEVEL) then
  2533.         #
  2534.         # This is a "top-level" shell,
  2535.         # perhaps a login shell, perhaps a shell started up by
  2536.         # 'rsh machine some-command'
  2537.         # This is where we should set PATH and anything else we
  2538.         # want to apply to every one of our shells.
  2539.         #
  2540.         setenv      CSHLEVEL        0
  2541.         set home = ~username        # just to be sure
  2542.         source ~/.env               # environment stuff we always want
  2543.     else
  2544.         #
  2545.         # This shell is a child of one of our other shells so
  2546.         # we don't need to set all the environment variables again.
  2547.         #
  2548.         set tmp = $CSHLEVEL
  2549.         @ tmp++
  2550.         setenv      CSHLEVEL        $tmp
  2551.     endif
  2552.  
  2553.     # Exit from .cshrc if not interactive, e.g. under rsh
  2554.     if (! $?prompt) exit
  2555.  
  2556.     # Here we could set the prompt or aliases that would be useful
  2557.     # for interactive shells only.
  2558.  
  2559.     source ~/.aliases
  2560.  
  2561. 2.11) How do I construct a shell glob-pattern that matches all files
  2562.       except "." and ".." ?
  2563.  
  2564.       You'd think this would be easy.
  2565.  
  2566.       *        Matches all files that don't begin with a ".";
  2567.  
  2568.       .*         Matches all files that do begin with a ".", but
  2569.          this includes the special entries "." and "..",
  2570.          which often you don't want;
  2571.  
  2572.       .[!.]*   (Newer shells only; some shells use a "^" instead of
  2573.          the "!"; POSIX shells must accept the "!", but may
  2574.          accept a "^" as well; all portable applications shall
  2575.          not use an unquoted "^" immediately following the "[")
  2576.  
  2577.          Matches all files that begin with a "." and are
  2578.          followed by a non-"."; unfortunately this will miss
  2579.          "..foo";
  2580.  
  2581.       .??*     Matches files that begin with a "." and which are
  2582.          at least 3 characters long.  This neatly avoids
  2583.          "." and "..", but also misses ".a" .
  2584.  
  2585.       So to match all files except "." and ".." safely you have to use
  2586.       3 patterns (if you don't have filenames like ".a" you can leave
  2587.       out the first):
  2588.  
  2589.     .[!.]* .??* *
  2590.  
  2591.       Alternatively you could employ an external program or two and use
  2592.       backquote substitution.  This is pretty good:
  2593.  
  2594.       `ls -a | sed -e '/^\.$/d' -e '/^\.\.$/d'`
  2595.  
  2596.     (or `ls -A` in some Unix versions)
  2597.  
  2598.       but even it will mess up on files with newlines, IFS characters
  2599.       or wildcards in their names.
  2600.  
  2601. 2.12) How do I find the last argument in a Bourne shell script?
  2602.  
  2603.       Answer by:
  2604.     Martin Weitzel <@mikros.systemware.de:martin@mwtech.uucp>
  2605.     Maarten Litmaath <maart@nat.vu.nl>
  2606.  
  2607.       If you are sure the number of arguments is at most 9, you can use:
  2608.  
  2609.     eval last=\${$#}
  2610.  
  2611.       In POSIX-compatible shells it works for ANY number of arguments.
  2612.       The following works always too:
  2613.  
  2614.     for last
  2615.     do
  2616.         :
  2617.     done
  2618.  
  2619.       This can be generalized as follows:
  2620.  
  2621.     for i
  2622.     do
  2623.         third_last=$second_last
  2624.         second_last=$last
  2625.         last=$i
  2626.     done
  2627.  
  2628.       Now suppose you want to REMOVE the last argument from the list,
  2629.       or REVERSE the argument list, or ACCESS the N-th argument
  2630.       directly, whatever N may be.  Here is a basis of how to do it,
  2631.       using only built-in shell constructs, without creating subprocesses:
  2632.  
  2633.     t0= u0= rest='1 2 3 4 5 6 7 8 9' argv=
  2634.  
  2635.     for h in '' $rest
  2636.     do
  2637.         for t in "$t0" $rest
  2638.         do
  2639.             for u in $u0 $rest
  2640.             do
  2641.                 case $# in
  2642.                 0)
  2643.                     break 3
  2644.                 esac
  2645.                 eval argv$h$t$u=\$1
  2646.                 argv="$argv \"\$argv$h$t$u\""    # (1)
  2647.                 shift
  2648.             done
  2649.             u0=0
  2650.         done
  2651.         t0=0
  2652.     done
  2653.  
  2654.     # now restore the arguments
  2655.     eval set x "$argv"                    # (2)
  2656.     shift
  2657.  
  2658.       This example works for the first 999 arguments.  Enough?
  2659.       Take a good look at the lines marked (1) and (2) and convince
  2660.       yourself that the original arguments are restored indeed, no
  2661.       matter what funny characters they contain!
  2662.  
  2663.       To find the N-th argument now you can use this:
  2664.  
  2665.     eval argN=\$argv$N
  2666.  
  2667.       To reverse the arguments the line marked (1) must be changed to:
  2668.  
  2669.     argv="\"\$argv$h$t$u\" $argv"
  2670.  
  2671.       How to remove the last argument is left as an exercise.
  2672.  
  2673.       If you allow subprocesses as well, possibly executing nonbuilt-in
  2674.       commands, the `argvN' variables can be set up more easily:
  2675.  
  2676.     N=1
  2677.  
  2678.     for i
  2679.     do
  2680.         eval argv$N=\$i
  2681.         N=`expr $N + 1`
  2682.     done
  2683.  
  2684.       To reverse the arguments there is still a simpler method, that
  2685.       even does not create subprocesses.  This approach can also be
  2686.       taken if you want to delete e.g. the last argument, but in that
  2687.       case you cannot refer directly to the N-th argument any more,
  2688.       because the `argvN' variables are set up in reverse order:
  2689.  
  2690.     argv=
  2691.  
  2692.     for i
  2693.     do
  2694.         eval argv$#=\$i
  2695.         argv="\"\$argv$#\" $argv"
  2696.         shift
  2697.     done
  2698.  
  2699.     eval set x "$argv"
  2700.     shift
  2701.  
  2702. 2.13) What's wrong with having '.' in your $PATH ?
  2703.  
  2704.       A bit of background: the PATH environment variable is a list of
  2705.       directories separated by colons.  When you type a command name
  2706.       without giving an explicit path (e.g. you type "ls", rather than
  2707.       "/bin/ls") your shell searches each directory in the PATH list in
  2708.       order, looking for an executable file by that name, and the shell
  2709.       will run the first matching program it finds.
  2710.  
  2711.       One of the directories in the PATH list can be the current
  2712.       directory "." .  It is also permissible to use an empty directory
  2713.       name in the PATH list to indicate the current directory.  Both of
  2714.       these are equivalent
  2715.  
  2716.       for csh users:
  2717.  
  2718.     setenv PATH :/usr/ucb:/bin:/usr/bin
  2719.     setenv PATH .:/usr/ucb:/bin:/usr/bin
  2720.  
  2721.       for sh or ksh users
  2722.  
  2723.     PATH=:/usr/ucb:/bin:/usr/bin export PATH
  2724.     PATH=.:/usr/ucb:/bin:/usr/bin export PATH
  2725.  
  2726.       Having "." somewhere in the PATH is convenient - you can type
  2727.       "a.out" instead of "./a.out" to run programs in the current
  2728.       directory.  But there's a catch.
  2729.  
  2730.       Consider what happens in the case  where "." is the first entry
  2731.       in the PATH.  Suppose your current directory is a publically-
  2732.       writable one, such as "/tmp".  If there just happens to be a
  2733.       program named "/tmp/ls" left there by some other user, and you
  2734.       type "ls" (intending, of course, to run the normal "/bin/ls"
  2735.       program), your shell will instead run "./ls", the other user's
  2736.       program.  Needless to say, the results of running an unknown
  2737.       program like this might surprise you.
  2738.  
  2739.       It's slightly better to have "." at the end of the PATH:
  2740.  
  2741.     setenv PATH /usr/ucb:/bin:/usr/bin:.
  2742.  
  2743.       Now if you're in /tmp and you type "ls", the shell will
  2744.       search /usr/ucb, /bin and /usr/bin for a program named
  2745.       "ls" before it gets around to looking in ".", and there
  2746.       is less risk of inadvertently running some other user's
  2747.       "ls" program.  This isn't 100% secure though - if you're
  2748.       a clumsy typist and some day type "sl -l" instead of "ls -l",
  2749.       you run the risk of running "./sl", if there is one.
  2750.       Some "clever" programmer could anticipate common typing
  2751.       mistakes and leave programs by those names scattered
  2752.       throughout public directories.  Beware.
  2753.  
  2754.       Many seasoned Unix users get by just fine without having
  2755.       "." in the PATH at all:
  2756.  
  2757.     setenv PATH /usr/ucb:/bin:/usr/bin
  2758.  
  2759.       If you do this, you'll need to type "./program" instead
  2760.       of "program" to run programs in the current directory, but
  2761.       the increase in security is probably worth it.
  2762.  
  2763. -- 
  2764. Ted Timar - tmatimar@empress.com
  2765. Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3
  2766.  
  2767. -----------------------------
  2768.  
  2769. From: Ted M A Timar <tmatimar@empress.com>
  2770. Subject: Frequently Asked Questions about Unix (4/7) [Biweekly posting]
  2771. Date: 20 Nov 92 06:00:49 GMT
  2772. Expires: 18 Dec 1992 06:00:22 GMT
  2773. Followup-To: comp.unix.questions
  2774. Approved: news-answers-request@MIT.Edu
  2775. Supersedes: <unix-faq/part4_721029617@athena.mit.edu>
  2776. NNTP-Posting-Host: pit-manager.mit.edu
  2777. X-Last-Updated: 1992/10/21
  2778. To:       info-unix@sem.brl.mil
  2779.  
  2780. Archive-name: unix-faq/part4
  2781. Version: $Id: part4,v 2.0 92/10/20 12:07:10 tmatimar Exp $
  2782.  
  2783. These seven articles contain the answers to some Frequently Asked
  2784. Questions often seen in comp.unix.questions and comp.unix.shell.
  2785. Please don't ask these questions again, they've been answered plenty
  2786. of times already - and please don't flame someone just because they may
  2787. not have read this particular posting.  Thank you.
  2788.  
  2789. These articles are divided approximately as follows:
  2790.  
  2791.       1.*) General questions.
  2792.       2.*) Relatively basic questions, likely to be asked by beginners.
  2793.       3.*) Intermediate questions.
  2794.       4.*) Advanced questions, likely to be asked by people who thought
  2795.        they already knew all of the answers.
  2796.       5.*) Questions pertaining to the various shells, and the differences.
  2797.       6.*) An overview of Unix variants.
  2798.       7.*) An comparison of configuration management systems (RCS, SCCS).
  2799.  
  2800. This article includes answers to:
  2801.  
  2802.       4.1)  How do I read characters from a terminal without requiring the user
  2803.               to hit RETURN?
  2804.       4.2)  How do I check to see if there are characters to be read without
  2805.               actually reading?
  2806.       4.3)  How do I find the name of an open file?
  2807.       4.4)  How can an executing program determine its own pathname?
  2808.       4.5)  How do I use popen() to open a process for reading AND writing?
  2809.       4.6)  How do I sleep() in a C program for less than one second?
  2810.       4.7)  How can I get setuid shell scripts to work?
  2811.       4.8)  How can I find out which user or process has a file open or is using
  2812.             a particular file system (so that I can unmount it?)
  2813.       4.9)  How do I keep track of people who are fingering me?
  2814.       4.10) Is it possible to reconnect a process to a terminal after it has
  2815.             been disconnected, e.g. after starting a program in the background
  2816.             and logging out?
  2817.       4.11) Is it possible to "spy" on a terminal, displaying the output
  2818.             that's appearing on it on another terminal?
  2819.  
  2820. If you're looking for the answer to, say, question 4.5, and want to skip
  2821. everything else, you can search ahead for the regular expression "^4.5)".
  2822.  
  2823. While these are all legitimate questions, they seem to crop up in
  2824. comp.unix.questions or comp.unix.shell on an annual basis, usually
  2825. followed by plenty of replies (only some of which are correct) and then
  2826. a period of griping about how the same questions keep coming up.  You
  2827. may also like to read the monthly article "Answers to Frequently Asked
  2828. Questions" in the newsgroup "news.announce.newusers", which will tell
  2829. you what "UNIX" stands for.
  2830.  
  2831. With the variety of Unix systems in the world, it's hard to guarantee
  2832. that these answers will work everywhere.  Read your local manual pages
  2833. before trying anything suggested here.  If you have suggestions or
  2834. corrections for any of these answers, please send them to to
  2835. tmatimar@empress.com.
  2836.  
  2837. 4.1)  How do I read characters from a terminal without requiring the user
  2838.       to hit RETURN?
  2839.  
  2840.       Check out cbreak mode in BSD, ~ICANON mode in SysV.
  2841.  
  2842.       If you don't want to tackle setting the terminal parameters
  2843.       yourself (using the "ioctl(2)" system call) you can let the stty
  2844.       program do the work - but this is slow and inefficient, and you
  2845.       should change the code to do it right some time:
  2846.  
  2847.       #include <stdio.h>
  2848.       main()
  2849.       {
  2850.         int c;
  2851.  
  2852.         printf("Hit any character to continue\n");
  2853.         /*
  2854.          * ioctl() would be better here; only lazy
  2855.          * programmers do it this way:
  2856.          */
  2857.         system("/bin/stty cbreak");        /* or "stty raw" */
  2858.         c = getchar();
  2859.         system("/bin/stty -cbreak");
  2860.         printf("Thank you for typing %c.\n", c);
  2861.  
  2862.         exit(0);
  2863.       }
  2864.  
  2865.       You might like to check out the documentation for the "curses"
  2866.       library of portable screen functions.  Often if you're interested
  2867.       in single-character I/O like this, you're also interested in
  2868.       doing some sort of screen display control, and the curses library
  2869.       provides various portable routines for both functions.
  2870.  
  2871. 4.2)  How do I check to see if there are characters to be read without
  2872.       actually reading?
  2873.  
  2874.       Certain versions of UNIX provide ways to check whether characters
  2875.       are currently available to be read from a file descriptor.  In
  2876.       BSD, you can use select(2).  You can also use the FIONREAD ioctl
  2877.       (see tty(4)), which returns the number of characters waiting to
  2878.       be read, but only works on terminals, pipes and sockets.  In
  2879.       System V Release 3, you can use poll(2), but that only works on
  2880.       streams.  In Xenix - and therefore Unix SysV r3.2 and later - the
  2881.       rdchk() system call reports whether a read() call on a given file
  2882.       descriptor will block.
  2883.  
  2884.       There is no way to check whether characters are available to be
  2885.       read from a FILE pointer.  (You could poke around inside stdio
  2886.       data structures to see if the input buffer is nonempty, but that
  2887.       wouldn't work since you'd have no way of knowing what will happen
  2888.       the next time you try to fill the buffer.)
  2889.  
  2890.       Sometimes people ask this question with the intention of writing
  2891.         if (characters available from fd)
  2892.             read(fd, buf, sizeof buf);
  2893.       in order to get the effect of a nonblocking read.  This is not
  2894.       the best way to do this, because it is possible that characters
  2895.       will be available when you test for availability, but will no
  2896.       longer be available when you call read.  Instead, set the
  2897.       O_NDELAY flag (which is also called FNDELAY under BSD) using the
  2898.       F_SETFL option of fcntl(2).  Older systems (Version 7, 4.1 BSD)
  2899.       don't have O_NDELAY; on these systems the closest you can get to
  2900.       a nonblocking read is to use alarm(2) to time out the read.
  2901.  
  2902. 4.3)  How do I find the name of an open file?
  2903.  
  2904.       In general, this is too difficult.  The file descriptor may
  2905.       be attached to a pipe or pty, in which case it has no name.
  2906.       It may be attached to a file that has been removed.  It may
  2907.       have multiple names, due to either hard or symbolic links.
  2908.  
  2909.       If you really need to do this, and be sure you think long
  2910.       and hard about it and have decided that you have no choice,
  2911.       you can use find with the -inum and possibly -xdev option,
  2912.       or you can use ncheck, or you can recreate the functionality
  2913.       of one of these within your program.  Just realize that
  2914.       searching a 600 megabyte filesystem for a file that may not
  2915.       even exist is going to take some time.
  2916.  
  2917. 4.4)  How can an executing program determine its own pathname?
  2918.  
  2919.       Your program can look at argv[0]; if it begins with a "/", it is
  2920.       probably the absolute pathname to your program, otherwise your
  2921.       program can look at every directory named in the environment
  2922.       variable PATH and try to find the first one that contains an
  2923.       executable file whose name matches your program's argv[0] (which
  2924.       by convention is the name of the file being executed).  By
  2925.       concatenating that directory and the value of argv[0] you'd
  2926.       probably have the right name.
  2927.  
  2928.       You can't really be sure though, since it is quite legal for one
  2929.       program to exec() another with any value of argv[0] it desires.
  2930.       It is merely a convention that new programs are exec'd with the
  2931.       executable file name in argv[0].
  2932.  
  2933.       For instance, purely a hypothetical example:
  2934.     
  2935.     #include <stdio.h>
  2936.     main()
  2937.     {
  2938.         execl("/usr/games/rogue", "vi Thesis", (char *)NULL);
  2939.     }
  2940.  
  2941.       The executed program thinks its name (its argv[0] value) is
  2942.       "vi Thesis".   (Certain other programs might also think that
  2943.       the name of the program you're currently running is "vi Thesis",
  2944.       but of course this is just a hypothetical example, don't
  2945.       try it yourself :-)
  2946.  
  2947. 4.5)  How do I use popen() to open a process for reading AND writing?
  2948.  
  2949.       The problem with trying to pipe both input and output to an
  2950.       arbitrary slave process is that deadlock can occur, if both
  2951.       processes are waiting for not-yet-generated input at the same
  2952.       time.  Deadlock can be avoided only by having BOTH sides follow a
  2953.       strict deadlock-free protocol, but since that requires
  2954.       cooperation from the processes it is inappropriate for a
  2955.       popen()-like library function.
  2956.  
  2957.       The 'expect' distribution includes a library of functions that a
  2958.       C programmer can call directly.  One of the functions does the
  2959.       equivalent of a popen for both reading and writing.  It uses ptys
  2960.       rather than pipes, and has no deadlock problem.  It's portable to
  2961.       both BSD and SV.  See the next answer for more about 'expect'.
  2962.  
  2963. 4.6)  How do I sleep() in a C program for less than one second?
  2964.  
  2965.       The first thing you need to be aware of is that all you can
  2966.       specify is a MINIMUM amount of delay; the actual delay will
  2967.       depend on scheduling issues such as system load, and could be
  2968.       arbitrarily large if you're unlucky.
  2969.  
  2970.       There is no standard library function that you can count on in
  2971.       all environments for "napping" (the usual name for short
  2972.       sleeps).  Some environments supply a "usleep(n)" function which
  2973.       suspends execution for n microseconds.  If your environment
  2974.       doesn't support usleep(), here are a couple of implementations
  2975.       for BSD and System V environments.
  2976.  
  2977.       The following code is adapted from Doug Gwyn's System V emulation
  2978.       support for 4BSD and exploits the 4BSD select() system call.
  2979.       Doug originally called it 'nap()'; you probably want to call it
  2980.       "usleep()";
  2981.  
  2982.       /*
  2983.         usleep -- support routine for 4.2BSD system call emulations
  2984.         last edit:    29-Oct-1984    D A Gwyn
  2985.       */
  2986.  
  2987.       extern int    select();
  2988.  
  2989.       int
  2990.       usleep( usec )                /* returns 0 if ok, else -1 */
  2991.         long        usec;        /* delay in microseconds */
  2992.         {
  2993.         static struct            /* `timeval' */
  2994.             {
  2995.             long    tv_sec;        /* seconds */
  2996.             long    tv_usec;    /* microsecs */
  2997.             }    delay;        /* _select() timeout */
  2998.  
  2999.         delay.tv_sec = usec / 1000000L;
  3000.         delay.tv_usec = usec % 1000000L;
  3001.  
  3002.         return select( 0, (long *)0, (long *)0, (long *)0, &delay );
  3003.         }
  3004.  
  3005.       On System V you might do it this way:
  3006.  
  3007.       /*
  3008.       subseconds sleeps for System V - or anything that has poll()
  3009.       Don Libes, 4/1/1991
  3010.  
  3011.       The BSD analog to this function is defined in terms of
  3012.       microseconds while poll() is defined in terms of milliseconds.
  3013.       For compatibility, this function provides accuracy "over the long
  3014.       run" by truncating actual requests to milliseconds and
  3015.       accumulating microseconds across calls with the idea that you are
  3016.       probably calling it in a tight loop, and that over the long run,
  3017.       the error will even out.
  3018.  
  3019.       If you aren't calling it in a tight loop, then you almost
  3020.       certainly aren't making microsecond-resolution requests anyway,
  3021.       in which case you don't care about microseconds.  And if you did,
  3022.       you wouldn't be using UNIX anyway because random system
  3023.       indigestion (i.e., scheduling) can make mincemeat out of any
  3024.       timing code.
  3025.  
  3026.       Returns 0 if successful timeout, -1 if unsuccessful.
  3027.  
  3028.       */
  3029.  
  3030.       #include <poll.h>
  3031.  
  3032.       int
  3033.       usleep(usec)
  3034.       unsigned int usec;        /* microseconds */
  3035.       {
  3036.         static subtotal = 0;    /* microseconds */
  3037.         int msec;            /* milliseconds */
  3038.  
  3039.         /* 'foo' is only here because some versions of 5.3 have
  3040.          * a bug where the first argument to poll() is checked
  3041.          * for a valid memory address even if the second argument is 0.
  3042.          */
  3043.         struct pollfd foo;
  3044.  
  3045.         subtotal += usec;
  3046.         /* if less then 1 msec request, do nothing but remember it */
  3047.         if (subtotal < 1000) return(0);
  3048.         msec = subtotal/1000;
  3049.         subtotal = subtotal%1000;
  3050.         return poll(&foo,(unsigned long)0,msec);
  3051.       }
  3052.  
  3053.       Another possibility for nap()ing on System V, and probably other
  3054.       non-BSD Unices is Jon Zeeff's s5nap package, posted to
  3055.       comp.sources.misc, volume 4.  It does require a installing a
  3056.       device driver, but works flawlessly once installed.  (Its
  3057.       resolution is limited to the kernel HZ value, since it uses the
  3058.       kernel delay() routine.)
  3059.  
  3060. 4.7)  How can I get setuid shell scripts to work?
  3061.  
  3062.       [ This is a long answer, but it's a complicated and frequently-asked
  3063.         question.  Thanks to Maarten Litmaath for this answer, and
  3064.         for the "indir" program mentioned below. ]
  3065.  
  3066.       Let us first assume you are on a UNIX variant (e.g. 4.3BSD or
  3067.       SunOS) that knows about so-called `executable shell scripts'.
  3068.       Such a script must start with a line like:
  3069.  
  3070.     #!/bin/sh
  3071.  
  3072.       The script is called `executable' because just like a real (binary)
  3073.       executable it starts with a so-called `magic number' indicating
  3074.       the type of the executable.  In our case this number is `#!' and
  3075.       the OS takes the rest of the first line as the interpreter for
  3076.       the script, possibly followed by 1 initial option like:
  3077.  
  3078.     #!/bin/sed -f
  3079.  
  3080.       Suppose this script is called `foo' and is found in /bin,
  3081.       then if you type:
  3082.  
  3083.     foo arg1 arg2 arg3
  3084.  
  3085.       the OS will rearrange things as though you had typed:
  3086.  
  3087.     /bin/sed -f /bin/foo arg1 arg2 arg3
  3088.  
  3089.       There is one difference though: if the setuid permission bit for
  3090.       `foo' is set, it will be honored in the first form of the
  3091.       command; if you really type the second form, the OS will honor
  3092.       the permission bits of /bin/sed, which is not setuid, of course.
  3093.  
  3094.       ----------
  3095.  
  3096.       OK, but what if my shell script does NOT start with such a `#!'
  3097.       line or my OS does not know about it?
  3098.  
  3099.       Well, if the shell (or anybody else) tries to execute it, the OS
  3100.       will return an error indication, as the file does not start with
  3101.       a valid magic number.  Upon receiving this indication the shell
  3102.       ASSUMES the file to be a shell script and gives it another try:
  3103.  
  3104.     /bin/sh shell_script arguments
  3105.  
  3106.       But we have already seen that a setuid bit on `shell_script' will
  3107.       NOT be honored in this case!
  3108.  
  3109.       ----------
  3110.  
  3111.       Right, but what about the security risks of setuid shell scripts?
  3112.  
  3113.       Well, suppose the script is called `/etc/setuid_script', starting
  3114.       with:
  3115.  
  3116.     #!/bin/sh
  3117.     
  3118.       Now let us see what happens if we issue the following commands:
  3119.  
  3120.     $ cd /tmp
  3121.     $ ln /etc/setuid_script -i
  3122.     $ PATH=.
  3123.     $ -i
  3124.  
  3125.       We know the last command will be rearranged to:
  3126.  
  3127.     /bin/sh -i
  3128.  
  3129.       But this command will give us an interactive shell, setuid to the
  3130.       owner of the script!
  3131.       Fortunately this security hole can easily be closed by making the
  3132.       first line:
  3133.  
  3134.     #!/bin/sh -
  3135.  
  3136.       The `-' signals the end of the option list: the next argument `-i'
  3137.       will be taken as the name of the file to read commands from, just
  3138.       like it should!
  3139.  
  3140.       ---------
  3141.  
  3142.       There are more serious problems though:
  3143.  
  3144.     $ cd /tmp
  3145.     $ ln /etc/setuid_script temp
  3146.     $ nice -20 temp &
  3147.     $ mv my_script temp
  3148.  
  3149.       The third command will be rearranged to:
  3150.  
  3151.     nice -20 /bin/sh - temp
  3152.  
  3153.       As this command runs so slowly, the fourth command might be able
  3154.       to replace the original `temp' with `my_script' BEFORE `temp' is
  3155.       opened by the shell!  There are 4 ways to fix this security hole:
  3156.  
  3157.     1)  let the OS start setuid scripts in a different, secure way
  3158.         - System V R4 and 4.4BSD use the /dev/fd driver to pass the
  3159.         interpreter a file descriptor for the script
  3160.  
  3161.     2)  let the script be interpreted indirectly, through a frontend
  3162.         that makes sure everything is all right before starting the
  3163.         real interpreter - if you use the `indir' program from
  3164.         comp.sources.unix the setuid script will look like this:
  3165.  
  3166.         #!/bin/indir -u
  3167.         #?/bin/sh /etc/setuid_script
  3168.  
  3169.     3)  make a `binary wrapper': a real executable that is setuid and
  3170.         whose only task is to execute the interpreter with the name of
  3171.         the script as an argument
  3172.  
  3173.     4)  make a general `setuid script server' that tries to locate the
  3174.         requested `service' in a database of valid scripts and upon
  3175.         success will start the right interpreter with the right
  3176.         arguments.
  3177.  
  3178.       ---------
  3179.  
  3180.       Now that we have made sure the right file gets interpreted, are
  3181.       there any risks left?
  3182.  
  3183.       Certainly!  For shell scripts you must not forget to set the PATH
  3184.       variable to a safe path explicitly.  Can you figure out why?
  3185.       Also there is the IFS variable that might cause trouble if not
  3186.       set properly.  Other environment variables might turn out to
  3187.       compromise security as well, e.g. SHELL...  Furthermore you must
  3188.       make sure the commands in the script do not allow interactive
  3189.       shell escapes!  Then there is the umask which may have been set
  3190.       to something strange...
  3191.  
  3192.       Etcetera.  You should realise that a setuid script `inherits' all
  3193.       the bugs and security risks of the commands that it calls!
  3194.  
  3195.       All in all we get the impression setuid shell scripts are quite a
  3196.       risky business!  You may be better off writing a C program instead!
  3197.  
  3198. 4.8)  How can I find out which user or process has a file open or is using
  3199.       a particular file system (so that I can unmount it?)
  3200.  
  3201.       Use fuser (system V), fstat (BSD), ofiles (public domain) or
  3202.       pff (public domain).  These programs will tell you various things
  3203.       about processes using particular files.
  3204.  
  3205.       A port of the 4.3 BSD fstat to Dynix, SunOS and Ultrix
  3206.       can be found in archives of comp.sources.unix, volume 18.
  3207.  
  3208.       pff is part of the kstuff package, and works on quite a few systems.
  3209.       Instructions for obtaining kstuff are provided in question 3.10.
  3210.  
  3211. 4.9)  How do I keep track of people who are fingering me?
  3212.  
  3213.       Generally, you can't find out the userid of someone who is
  3214.       fingering you from a remote machine.  You may be able to
  3215.       find out which machine the remote request is coming from.
  3216.       One possibility, if your system supports it and assuming
  3217.       the finger daemon doesn't object, is to make your .plan file a
  3218.       "named pipe" instead of a plain file.  (Use 'mknod' to do this.)
  3219.  
  3220.       You can then start up a program that will open your .plan file
  3221.       for writing; the open will block until some other process (namely
  3222.       fingerd) opens the .plan for reading.  Now you can whatever you
  3223.       want through this pipe, which lets you show different .plan
  3224.       information every time someone fingers you.
  3225.  
  3226.       Of course, this may not work at all if your system doesn't
  3227.       support named pipes or if your local fingerd insists
  3228.       on having plain .plan files.
  3229.  
  3230.       Your program can also take the opportunity to look at the output
  3231.       of "netstat" and spot where an incoming finger connection is
  3232.       coming from, but this won't get you the remote user.
  3233.  
  3234.       Getting the remote userid would require that the remote site be
  3235.       running an identity service such as RFC 931.  There are now three
  3236.       RFC 931 implementations for popular BSD machines, and several
  3237.       applications (such as the wuarchive ftpd) supporting the server.
  3238.       For more information join the rfc931-users mailing list,
  3239.       rfc931-users-request@kramden.acf.nyu.edu.
  3240.  
  3241.       There are two caveats relating to this answer.  The first is that
  3242.       many NFS systems won't allow the recognize the named pipe
  3243.       correctly.  This means that trying to read the pipe on another
  3244.       machine will either block until it times out, or see it as a
  3245.       zero-length file, and never print it.
  3246.  
  3247.       The second problem is that on many systems, fingerd checks that
  3248.       the .plan file contains data (and is readable) before trying to
  3249.       read it.  This will not cause remote fingers to miss your .plan
  3250.       file entirely.
  3251.  
  3252. 4.10) Is it possible to reconnect a process to a terminal after it has
  3253.       been disconnected, e.g. after starting a program in the background
  3254.       and logging out?
  3255.  
  3256.       Most variants of Unix do not support "detaching" and "attaching"
  3257.       processes, as operating systems such as VMS and Multics support.
  3258.       However, there are two freely redistributable packages which can
  3259.       be used to start processes in such a way that they can be later
  3260.       reattached to a terminal.
  3261.  
  3262.       The first is "screen," which is described in the
  3263.       comp.sources.unix archives as "Screen, multiple windows on a CRT"
  3264.       (see the "screen-3.2" package in comp.sources.misc, volume 28.)
  3265.       This package will run on at least BSD, System V r3.2 and SCO UNIX.
  3266.  
  3267.       The second is "pty," which is described in the comp.sources.unix
  3268.       archives as a package to "Run a program under a pty session" (see
  3269.       "pty" in volume 23).  pty is designed for use under BSD-like
  3270.       system only.
  3271.  
  3272.       Neither of these packages is retroactive, i.e. you must have
  3273.       started a process under screen or pty in order to be able to
  3274.       detach and reattach it.
  3275.  
  3276. 4.11) Is it possible to "spy" on a terminal, displaying the output
  3277.       that's appearing on it on another terminal?
  3278.  
  3279.       There are a few different ways you can do this, although none
  3280.       of them is perfect:
  3281.  
  3282.       * kibitz allows two (or more) people to interact with a shell
  3283.         (or any arbitary program).  Uses include:
  3284.  
  3285.     - watching or aiding another person's terminal session;
  3286.     - recording a conversation while retaining the ability to
  3287.       scroll backwards, save the conversation, or even edit it
  3288.       while in progress;
  3289.     - teaming up on games, document editing, or other cooperative
  3290.       tasks where each person has strengths and weakness that
  3291.       complement one another.
  3292.  
  3293.         kibitz comes as part of the expect distribution.  See question 3.9.
  3294.  
  3295.         kibitz requires permission from the person to be spyed upon.  To
  3296.         spy without permission requires less pleasant approaches:
  3297.  
  3298.       * You can write a program that grovels through Kernel structures
  3299.         and watches the output buffer for the terminal in question,
  3300.         displaying characters as they are output.  This, obviously, is
  3301.         not something that should be attempted by anyone who does not
  3302.         have experience working with the Unix kernel.  Furthermore,
  3303.         whatever method you come up with will probably be quite
  3304.         non-portable.
  3305.  
  3306.       * If you want to do this to a particular hard-wired terminal all
  3307.         the time (e.g. if you want operators to be able to check the
  3308.         console terminal of a machine from other machines), you can
  3309.         actually splice a monitor into the cable for the terminal.  For
  3310.         example, plug the monitor output into another machine's serial
  3311.         port, and run a program on that port that stores its input
  3312.         somewhere and then transmits it out *another* port, this one
  3313.         really going to the physical terminal.  If you do this, you have
  3314.         to make sure that any output from the terminal is transmitted
  3315.         back over the wire, although if you splice only into the
  3316.         computer->terminal wires, this isn't much of a problem.  This is
  3317.         not something that should be attempted by anyone who is not very
  3318.         familiar with terminal wiring and such.
  3319.  
  3320. -- 
  3321. Ted Timar - tmatimar@empress.com
  3322. Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3
  3323.  
  3324. -----------------------------
  3325.  
  3326. From: Ted M A Timar <tmatimar@empress.com>
  3327. Subject: Frequently Asked Questions about Unix (3/7) [Biweekly posting]
  3328. Date: 20 Nov 92 06:00:51 GMT
  3329. Expires: 18 Dec 1992 06:00:22 GMT
  3330. Followup-To: comp.unix.questions
  3331. Approved: news-answers-request@MIT.Edu
  3332. Supersedes: <unix-faq/part3_721029617@athena.mit.edu>
  3333. NNTP-Posting-Host: pit-manager.mit.edu
  3334. X-Last-Updated: 1992/10/21
  3335. To:       info-unix@sem.brl.mil
  3336.  
  3337. Archive-name: unix-faq/part3
  3338. Version: $Id: part3,v 2.0 92/10/20 12:07:07 tmatimar Exp $
  3339.  
  3340. These seven articles contain the answers to some Frequently Asked
  3341. Questions often seen in comp.unix.questions and comp.unix.shell.
  3342. Please don't ask these questions again, they've been answered plenty
  3343. of times already - and please don't flame someone just because they may
  3344. not have read this particular posting.  Thank you.
  3345.  
  3346. These articles are divided approximately as follows:
  3347.  
  3348.       1.*) General questions.
  3349.       2.*) Relatively basic questions, likely to be asked by beginners.
  3350.       3.*) Intermediate questions.
  3351.       4.*) Advanced questions, likely to be asked by people who thought
  3352.        they already knew all of the answers.
  3353.       5.*) Questions pertaining to the various shells, and the differences.
  3354.       6.*) An overview of Unix variants.
  3355.       7.*) An comparison of configuration management systems (RCS, SCCS).
  3356.  
  3357. This article includes answers to:
  3358.  
  3359.       3.1)  How do I find out the creation time of a file?
  3360.       3.2)  How do I use "rsh" without having the rsh hang around
  3361.               until the remote command has completed?
  3362.       3.3)  How do I truncate a file?
  3363.       3.4)  Why doesn't find's "{}" symbol do what I want?
  3364.       3.5)  How do I set the permissions on a symbolic link?
  3365.       3.6)  How do I "undelete" a file?
  3366.       3.7)  How can a process detect if it's running in the background?
  3367.       3.8)  Why doesn't redirecting a loop work as intended?  (Bourne shell)
  3368.       3.9)  How do I run 'passwd', 'ftp', 'telnet', 'tip' and other interactive
  3369.               programs from a shell script or in the background?
  3370.       3.10) How do I find out the process ID of a program with a particular
  3371.             name from inside a shell script or C program?
  3372.       3.11) How do I check the exit status of a remote command
  3373.             executed via "rsh" ?
  3374.       3.12) Is it possible to pass shell variable settings into an awk program?
  3375.       3.13) How do I get rid of zombie processes that persevere?
  3376.       3.14) How do I get lines from a pipe as they are written instead of
  3377.             only in larger blocks.
  3378.  
  3379. If you're looking for the answer to, say, question 3.5, and want to skip
  3380. everything else, you can search ahead for the regular expression "^3.5)".
  3381.  
  3382. While these are all legitimate questions, they seem to crop up in
  3383. comp.unix.questions or comp.unix.shell on an annual basis, usually
  3384. followed by plenty of replies (only some of which are correct) and then
  3385. a period of griping about how the same questions keep coming up.  You
  3386. may also like to read the monthly article "Answers to Frequently Asked
  3387. Questions" in the newsgroup "news.announce.newusers", which will tell
  3388. you what "UNIX" stands for.
  3389.  
  3390. With the variety of Unix systems in the world, it's hard to guarantee
  3391. that these answers will work everywhere.  Read your local manual pages
  3392. before trying anything suggested here.  If you have suggestions or
  3393. corrections for any of these answers, please send them to to
  3394. tmatimar@empress.com.
  3395.  
  3396. 3.1)  How do I find out the creation time of a file?
  3397.  
  3398.       You can't - it isn't stored anywhere.  Files have a last-modified
  3399.       time (shown by "ls -l"), a last-accessed time (shown by "ls -lu")
  3400.       and an inode change time (shown by "ls -lc"). The latter is often
  3401.       referred to as the "creation time" - even in some man pages -
  3402.       but that's wrong; it's also set by such operations as mv, ln,
  3403.       chmod, chown and chgrp.
  3404.  
  3405.       The man page for "stat(2)" discusses this.
  3406.  
  3407. 3.2)  How do I use "rsh" without having the rsh hang around until the
  3408.       remote command has completed?
  3409.  
  3410.       (See note in question 2.7 about what "rsh" we're talking about.)
  3411.  
  3412.       The obvious answers fail:
  3413.               rsh machine command &
  3414.       or      rsh machine 'command &'
  3415.  
  3416.       For instance, try doing   rsh machine 'sleep 60 &' and you'll see
  3417.       that the 'rsh' won't exit right away.  It will wait 60 seconds
  3418.       until the remote 'sleep' command finishes, even though that
  3419.       command was started in the background on the remote machine.  So
  3420.       how do you get the 'rsh' to exit immediately after the 'sleep' is
  3421.       started?
  3422.  
  3423.       The solution - if you use csh on the remote machine:
  3424.  
  3425.         rsh machine -n 'command >&/dev/null </dev/null &'
  3426.  
  3427.       If you use sh on the remote machine:
  3428.  
  3429.         rsh machine -n 'command >/dev/null 2>&1 </dev/null &'
  3430.  
  3431.       Why?  "-n" attaches rsh's stdin to /dev/null so you could run the
  3432.       complete rsh command in the background on the LOCAL machine.
  3433.       Thus "-n" is equivalent to another specific "< /dev/null".
  3434.       Furthermore, the input/output redirections on the REMOTE machine
  3435.       (inside the single quotes) ensure that rsh thinks the session can
  3436.       be terminated (there's no data flow any more.)
  3437.  
  3438.       Note: The file that you redirect to/from on the remote machine
  3439.       doesn't have to be /dev/null; any ordinary file will do.
  3440.  
  3441.       In many cases, various parts of these complicated commands
  3442.       aren't necessary.
  3443.  
  3444. 3.3)  How do I truncate a file?
  3445.  
  3446.       The BSD function ftruncate() sets the length of a file.  Xenix -
  3447.       and therefore SysV r3.2 and later - has the chsize() system
  3448.       call.  For other systems, the only kind of truncation you can do
  3449.       is truncation to length zero with creat() or open(..., O_TRUNC).
  3450.  
  3451. 3.4)  Why doesn't find's "{}" symbol do what I want?
  3452.  
  3453.       "find" has a -exec option that will execute a particular command
  3454.       on all the selected files. Find will replace any "{}" it sees
  3455.       with the name of the file currently under consideration.
  3456.  
  3457.       So, some day you might try to use "find" to run a command on
  3458.       every file, one directory at a time.  You might try this:
  3459.  
  3460.     find /path -type d -exec command {}/\* \;
  3461.  
  3462.       hoping that find will execute, in turn
  3463.  
  3464.     command directory1/*
  3465.     command directory2/*
  3466.     ...
  3467.  
  3468.       Unfortunately, find only expands the "{}" token when it appears
  3469.       by itself.  Find will leave anything else like "{}/*" alone, so
  3470.       instead of doing what you want, it will do
  3471.  
  3472.     command {}/*
  3473.     command {}/*
  3474.     ...
  3475.  
  3476.       once for each directory.  This might be a bug, it might be a
  3477.       feature, but we're stuck with the current behaviour.
  3478.  
  3479.       So how do you get around this?  One way would be to write a
  3480.       trivial little shell script, let's say "./doit", that consists of
  3481.  
  3482.     command "$1"/*
  3483.  
  3484.       You could then use
  3485.  
  3486.     find /path -type d -exec ./doit {} \;
  3487.  
  3488.       Or if you want to avoid the "./doit" shell script, you can use
  3489.  
  3490.     find /path -type d -exec sh -c 'command $0/*' {} \;
  3491.  
  3492.       (This works because within the 'command' of "sh -c 'command' A B C ...",
  3493.        $0 expands to A, $1 to B, and so on.)
  3494.  
  3495.       or you can use the construct-a-command-with-sed trick
  3496.  
  3497.     find /path -type d -print | sed 's:.*:command &/*:' | sh
  3498.  
  3499.       If all you're trying to do is cut down on the number of times
  3500.       that "command" is executed, you should see if your system has the
  3501.       "xargs" command.  Xargs reads arguments one line at a time from
  3502.       the standard input and assembles as many of them as will fit into
  3503.       one command line.  You could use
  3504.  
  3505.     find /path -print | xargs command
  3506.  
  3507.       which would result in one or more executions of
  3508.  
  3509.     command file1 file2 file3 file4 dir1/file1 dir1/file2
  3510.  
  3511.       Unfortunately this is not a perfectly robust or secure solution.
  3512.       Xargs expects its input lines to be terminated with newlines, so
  3513.       it will be confused by files with odd characters such as newlines
  3514.       in their names.
  3515.  
  3516. 3.5)  How do I set the permissions on a symbolic link?
  3517.  
  3518.       Permissions on a symbolic link don't really mean anything.  The
  3519.       only permissions that count are the permissions on the file that
  3520.       the link points to.
  3521.  
  3522. 3.6)  How do I "undelete" a file?
  3523.  
  3524.       Someday, you are going to accidentally type something like
  3525.       "rm * .foo", and find you just deleted "*" instead of "*.foo".
  3526.       Consider it a rite of passage.
  3527.  
  3528.       Of course, any decent systems administrator should be doing
  3529.       regular backups.  Check with your sysadmin to see if a recent
  3530.       backup copy of your file is available.  But if it isn't, read
  3531.       on.
  3532.  
  3533.       For all intents and purposes, when you delete a file with "rm" it
  3534.       is gone.  Once you "rm" a file, the system totally forgets which
  3535.       blocks scattered around the disk comprised your file.  Even
  3536.       worse, the blocks from the file you just deleted are going to be
  3537.       the first ones taken and scribbled upon when the system needs
  3538.       more disk space.  However, never say never.  It is theoretically
  3539.       possible *if* you shut down the system immediately after the "rm"
  3540.       to recover portions of the data.  However, you had better have a
  3541.       very wizardly type person at hand with hours or days to spare to
  3542.       get it all back.
  3543.  
  3544.       Your first reaction when you "rm" a file by mistake is why not
  3545.       make a shell alias or procedure which changes "rm" to move files
  3546.       into a trash bin rather than delete them?  That way you can
  3547.       recover them if you make a mistake, and periodically clean out
  3548.       your trash bin.  Two points:  first, this is generally accepted
  3549.       as a *bad* idea.  You will become dependent upon this behaviour
  3550.       of "rm", and you will find yourself someday on a normal system
  3551.       where "rm" is really "rm", and you will get yourself in trouble.
  3552.       Second, you will eventually find that the hassle of dealing with
  3553.       the disk space and time involved in maintaining the trash bin, it
  3554.       might be easier just to be a bit more careful with "rm".  For
  3555.       starters, you should look up the "-i" option to "rm" in your
  3556.       manual.
  3557.  
  3558.       If you are still undaunted, then here is a possible simple
  3559.       answer.  You can create yourself a "can" command which moves
  3560.       files into a trashcan directory. In csh(1) you can place the
  3561.       following commands in the ".login" file in your home directory:
  3562.  
  3563.     alias can    'mv \!* ~/.trashcan'       # junk file(s) to trashcan
  3564.     alias mtcan    'rm -f ~/.trashcan/*'       # irretrievably empty trash
  3565.     if ( ! -d ~/.trashcan ) mkdir ~/.trashcan  # ensure trashcan exists
  3566.  
  3567.       You might also want to put a:
  3568.  
  3569.     rm -f ~/.trashcan/*
  3570.  
  3571.       in the ".logout" file in your home directory to automatically
  3572.       empty the trash when you log out.  (sh and ksh versions are left
  3573.       as an exercise for the reader.)
  3574.  
  3575.       MIT's Project Athena has produced a comprehensive
  3576.       delete/undelete/expunge/purge package, which can serve as a
  3577.       complete replacement for rm which allows file recovery.  This
  3578.       package was posted to comp.sources.misc (volume 17, issue
  3579.       023-026)
  3580.  
  3581. 3.7)  How can a process detect if it's running in the background?
  3582.  
  3583.       First of all: do you want to know if you're running in the
  3584.       background, or if you're running interactively? If you're
  3585.       deciding whether or not you should print prompts and the like,
  3586.       that's probably a better criterion. Check if standard input
  3587.       is a terminal:
  3588.  
  3589.         sh: if [ -t 0 ]; then ... fi
  3590.         C: if(isatty(0)) { ... }
  3591.  
  3592.       In general, you can't tell if you're running in the background.
  3593.       The fundamental problem is that different shells and different
  3594.       versions of UNIX have different notions of what "foreground" and
  3595.       "background" mean - and on the most common type of system with a
  3596.       better-defined notion of what they mean, programs can be moved
  3597.       arbitrarily between foreground and background!
  3598.  
  3599.       UNIX systems without job control typically put a process into the
  3600.       background by ignoring SIGINT and SIGQUIT and redirecting the
  3601.       standard input to "/dev/null"; this is done by the shell.
  3602.  
  3603.       Shells that support job control, on UNIX systems that support job
  3604.       control, put a process into the background by giving it a process
  3605.       group ID different from the process group to which the terminal
  3606.       belongs.  They move it back into the foreground by setting the
  3607.       terminal's process group ID to that of the process.  Shells that
  3608.       do *not* support job control, on UNIX systems that support job
  3609.       control, typically do what shells do on systems that don't
  3610.       support job control.
  3611.  
  3612. 3.8)  Why doesn't redirecting a loop work as intended?  (Bourne shell)
  3613.  
  3614.       Take the following example:
  3615.  
  3616.     foo=bar
  3617.  
  3618.     while read line
  3619.     do
  3620.         # do something with $line
  3621.         foo=bletch
  3622.     done < /etc/passwd
  3623.  
  3624.     echo "foo is now: $foo"
  3625.  
  3626.       Despite the assignment ``foo=bletch'' this will print
  3627.       ``foo is now: bar'' in many implementations of the Bourne shell.
  3628.       Why?  Because of the following, often undocumented, feature of
  3629.       historic Bourne shells: redirecting a control structure (such as
  3630.       a loop, or an ``if'' statement) causes a subshell to be created,
  3631.       in which the structure is executed; variables set in that
  3632.       subshell (like the ``foo=bletch'' assignment) don't affect the
  3633.       current shell, of course.
  3634.  
  3635.       The POSIX 1003.2 Shell and Tools Interface standardization
  3636.       committee forbids the behaviour described above, i.e. in P1003.2
  3637.       conformant Bourne shells the example will print ``foo is now:
  3638.       bletch''.
  3639.  
  3640.       In historic (and P1003.2 conformant) implementations you can use
  3641.       the following `trick' to get around the redirection problem:
  3642.  
  3643.     foo=bar
  3644.  
  3645.     # make file descriptor 9 a duplicate of file descriptor 0 (stdin);
  3646.     # then connect stdin to /etc/passwd; the original stdin is now
  3647.     # `remembered' in file descriptor 9; see dup(2) and sh(1)
  3648.     exec 9<&0 < /etc/passwd
  3649.  
  3650.     while read line
  3651.     do
  3652.         # do something with $line
  3653.         foo=bletch
  3654.     done
  3655.  
  3656.     # make stdin a duplicate of file descriptor 9, i.e. reconnect
  3657.     # it to the original stdin; then close file descriptor 9
  3658.     exec 0<&9 9<&-
  3659.  
  3660.     echo "foo is now: $foo"
  3661.  
  3662.       This should always print ``foo is now: bletch''.
  3663.       Right, take the next example:
  3664.  
  3665.     foo=bar
  3666.  
  3667.     echo bletch | read foo
  3668.  
  3669.     echo "foo is now: $foo"
  3670.  
  3671.       This will print ``foo is now: bar'' in many implementations,
  3672.       ``foo is now: bletch'' in some others.  Why?  Generally each part
  3673.       of a pipeline is run in a different subshell; in some
  3674.       implementations though, the last command in the pipeline is made
  3675.       an exception: if it is a builtin command like ``read'', the
  3676.       current shell will execute it, else another subshell is created.
  3677.  
  3678.       POSIX 1003.2 allows both behaviours so portable scripts cannot
  3679.       depend on any of them.
  3680.  
  3681. 3.9)  How do I run 'passwd', 'ftp', 'telnet', 'tip' and other interactive
  3682.       programs from a shell script or in the background?
  3683.  
  3684.       These programs expect a terminal interface.  Shells makes no
  3685.       special provisions to provide one.  Hence, such programs cannot
  3686.       be automated in shell scripts.
  3687.  
  3688.       The 'expect' program provides a programmable terminal interface
  3689.       for automating interaction with such programs.  The following
  3690.       expect script is an example of a non-interactive version of
  3691.       passwd(1).
  3692.  
  3693.     # username is passed as 1st arg, password as 2nd
  3694.     set password [index $argv 2]
  3695.     spawn passwd [index $argv 1]
  3696.     expect "*password:"
  3697.     send "$password\r"
  3698.     expect "*password:"
  3699.     send "$password\r"
  3700.     expect eof
  3701.  
  3702.       expect can partially automate interaction which is especially
  3703.       useful for telnet, rlogin, debuggers or other programs that have
  3704.       no built-in command language.  The distribution provides an
  3705.       example script to rerun rogue until a good starting configuration
  3706.       appears.  Then, control is given back to the user to enjoy the game.
  3707.  
  3708.       Fortunately some programs have been written to manage the
  3709.       connection to a pseudo-tty so that you can run these sorts of
  3710.       programs in a script.
  3711.  
  3712.       To get expect, email "send pub/expect/expect.shar.Z" to
  3713.       library@cme.nist.gov or anonymous ftp same from
  3714.       durer.cme.nist.gov.
  3715.  
  3716.       Another solution is provided by the pty 4.0 program, which runs a
  3717.       program under a pseudo-tty session and was posted to
  3718.       comp.sources.unix, volume 25.  A pty-based solution using named
  3719.       pipes to do the same as the above might look like this:
  3720.  
  3721.     #!/bin/sh
  3722.     /etc/mknod out.$$ p; exec 2>&1
  3723.     ( exec 4<out.$$; rm -f out.$$
  3724.     <&4 waitfor 'password:'
  3725.         echo "$2"
  3726.     <&4 waitfor 'password:'
  3727.         echo "$2"
  3728.     <&4 cat >/dev/null
  3729.     ) | ( pty passwd "$1" >out.$$ )
  3730.  
  3731.       Here, 'waitfor' is a simple C program that searches for
  3732.       its argument in the input, character by character.
  3733.  
  3734.       A simpler pty solution (which has the drawback of not
  3735.       synchronizing properly with the passwd program) is
  3736.  
  3737.     #!/bin/sh
  3738.     ( sleep 5; echo "$2"; sleep 5; echo "$2") | pty passwd "$1"
  3739.  
  3740. 3.10) How do I find out the process ID of a program with a particular
  3741.       name from inside a shell script or C program?
  3742.  
  3743.       In a shell script:
  3744.  
  3745.       There is no utility specifically designed to map between program
  3746.       names and process IDs.  Furthermore, such mappings are often
  3747.       unreliable, since it's possible for more than one process to have
  3748.       the same name, and since it's possible for a process to change
  3749.       its name once it starts running.  However, a pipeline like this
  3750.       can often be used to get a list of processes (owned by you) with
  3751.       a particular name:
  3752.  
  3753.         ps ux | awk '/name/ && !/awk/ {print $2}'
  3754.  
  3755.       You replace "name" with the name of the process for which you are
  3756.       searching.
  3757.  
  3758.       The general idea is to parse the output of ps, using awk or grep
  3759.       or other utilities, to search for the lines with the specified
  3760.       name on them, and print the PID's for those lines.  Note that the
  3761.       "!/awk/" above prevents the awk process for being listed.
  3762.  
  3763.       You may have to change the arguments to ps, depending on what
  3764.       kind of Unix you are using.
  3765.  
  3766.       In a C program:
  3767.  
  3768.       Just as there is no utility specifically designed to map between
  3769.       program names and process IDs, there are no (portable) C library
  3770.       functions to do it either.
  3771.  
  3772.       However, some vendors provide functions for reading Kernel
  3773.       memory; for example, Sun provides the "kvm_" functions, and Data
  3774.       General provides the "dg_" functions.  It may be possible for any
  3775.       user to use these, or they may only be useable by the super-user
  3776.       (or a user in group "kmem") if read-access to kernel memory on
  3777.       your system is restricted.  Furthermore, these functions are
  3778.       often not documented or documented badly, and might change from
  3779.       release to release.
  3780.  
  3781.       Some vendors provide a "/proc" filesystem, which appears as a
  3782.       directory with a bunch of filenames in it.  Each filename is a
  3783.       number, corresponding to a process ID, and you can open the file
  3784.       and read it to get information about the process.  Once again,
  3785.       access to this may be restricted, and the interface to it may
  3786.       change from system to system.
  3787.  
  3788.       If you can't use vendor-specific library functions, and you
  3789.       don't have /proc, and you still want to do this completely
  3790.       in C, you
  3791.       are going to have to do the grovelling through kernel memory
  3792.       yourself.  For a good example of how to do this on many systems,
  3793.       see the sources to "ofiles", available in the comp.sources.unix
  3794.       archives.  (A package named "kstuff" to help with kernel
  3795.       grovelling was posted to alt.sources in May 1991 and is also
  3796.       available via anonymous ftp as
  3797.       usenet/alt.sources/articles/{329{6,7,8,9},330{0,1}}.Z from
  3798.       wuarchive.wustl.edu.)
  3799.  
  3800. 3.11) How do I check the exit status of a remote command
  3801.       executed via "rsh" ?
  3802.  
  3803.       This doesn't work:
  3804.  
  3805.     rsh some-machine some-crummy-command || echo "Command failed"
  3806.  
  3807.       The exit status of 'rsh' is 0 (success) if the rsh program
  3808.       itself completed successfully, which probably isn't what
  3809.       you wanted.
  3810.  
  3811.       If you want to check on the exit status of the remote program,
  3812.       you can try using Maarten Litmaath's 'ersh' script, which was
  3813.       posted to alt.sources in January, 1991.  ersh is a shell script
  3814.       that calls rsh, arranges for the remote machine to echo the
  3815.       status of the command after it completes, and exits with that
  3816.       status.
  3817.  
  3818. 3.12) Is it possible to pass shell variable settings into an awk program?
  3819.  
  3820.       There are two different ways to do this.  The first involves
  3821.       simply expanding the variable where it is needed in the program.
  3822.       For example, to get a list of all ttys you're using:
  3823.  
  3824.     who | awk '/^'"$USER"'/ { print $2 }'                (1)
  3825.  
  3826.       Single quotes are usually used to enclose awk programs because
  3827.       the character '$' is often used in them, and '$' will be
  3828.       interpreted by the shell if enclosed inside double quotes, but
  3829.       not if enclosed inside single quotes.  In this case, we *want*
  3830.       the '$' in "$USER" to be interpreted by the shell, so we close
  3831.       the single quotes and then put the "$USER" inside double quotes.
  3832.       Note that there are no spaces in any of that, so the shell will
  3833.       see it all as one argument.  Note, further, that the double
  3834.       quotes probably aren't necessary in this particular case (i.e. we
  3835.       could have done
  3836.  
  3837.     who | awk '/^'$USER'/ { print $2 }'                (2)
  3838.  
  3839.       ), but they should be included nevertheless because they are
  3840.       necessary when the shell variable in question contains special
  3841.       characters or spaces.
  3842.  
  3843.       The second way to pass variable settings into awk is to use an
  3844.       often undocumented feature of awk which allows variable settings
  3845.       to be specified as "fake file names" on the command line.  For
  3846.       example:
  3847.  
  3848.     who | awk '$1 == user { print $2 }' user="$USER" -        (3)
  3849.  
  3850.       Variable settings take effect when they are encountered on the
  3851.       command line, so, for example, you could instruct awk on how to
  3852.       behave for different files using this technique.  For example:
  3853.  
  3854.     awk '{ program that depends on s }' s=1 file1 s=0 file2        (4)
  3855.  
  3856.       Note that some versions of awk will cause variable settings
  3857.       encountered before any real filenames to take effect before the
  3858.       BEGIN block is executed, but some won't so neither way should be
  3859.       relied upon.
  3860.  
  3861.       Note, further, that when you specify a variable setting, awk
  3862.       won't automatically read from stdin if no real files are
  3863.       specified, so you need to add a "-" argument to the end of your
  3864.       command, as I did at (3) above.
  3865.  
  3866. 3.13) How do I get rid of zombie processes that persevere?
  3867.  
  3868.       From: jik@pit-manager.MIT.Edu (Jonathan I. Kamens)
  3869.       Date: Fri, 17 Jan 92 14:40:09 -0500
  3870.  
  3871.       Unfortunately, it's impossible to generalize how the death of
  3872.       child processes should behave, because the exact mechanism varies
  3873.       over the various flavors of Unix.
  3874.  
  3875.       First of all, by default, you have to do a wait() for child
  3876.       processes under ALL flavors of Unix.  That is, there is no flavor
  3877.       of Unix that I know of that will automatically flush child
  3878.       processes that exit, even if you don't do anything to tell it to
  3879.       do so.
  3880.  
  3881.       Second, under some SysV-derived systems, if you do
  3882.       "signal(SIGCHLD, SIG_IGN)" (well, actually, it may be SIGCLD
  3883.       instead of SIGCHLD, but most of the newer SysV systems have
  3884.       "#define SIGCHLD SIGCLD" in the header files), then child
  3885.       processes will be cleaned up automatically, with no further
  3886.       effort in your part.  The best way to find out if it works at
  3887.       your site is to try it, although if you are trying to write
  3888.       portable code, it's a bad idea to rely on this in any case.
  3889.       Unfortunately, POSIX doesn't allow you to do this; the behavior
  3890.       of setting the SIGCHLD to SIG_IGN under POSIX is undefined, so
  3891.       you can't do it if your program is supposed to be
  3892.       POSIX-compliant.
  3893.  
  3894.       If you can't use SIG_IGN to force automatic clean-up, then you've
  3895.       got to write a signal handler to do it.  It isn't easy at all to
  3896.       write a signal handler that does things right on all flavors of
  3897.       Unix, because of the following inconsistencies:
  3898.  
  3899.       On some flavors of Unix, the SIGCHLD signal handler is called if
  3900.       one *or more* children have died.  This means that if your signal
  3901.       handler only does one wait() call, then it won't clean up all of
  3902.       the children.  Fortunately, I believe that all Unix flavors for
  3903.       which this is the case have available to the programmer the
  3904.       wait3() call, which allows the WNOHANG option to check whether or
  3905.       not there are any children waiting to be cleaned up.  Therefore,
  3906.       on any system that has wait3(), your signal handler should call
  3907.       wait3() over and over again with the WNOHANG option until there
  3908.       are no children left to clean up.
  3909.  
  3910.       On SysV-derived systems, SIGCHLD signals are regenerated if there
  3911.       are child processes still waiting to be cleaned up after you exit
  3912.       the SIGCHLD signal handler.  Therefore, it's safe on most SysV
  3913.       systems to assume when the signal handler gets called that you
  3914.       only have to clean up one signal, and assume that the handler
  3915.       will get called again if there are more to clean up after it
  3916.       exits.
  3917.  
  3918.       On older systems, signal handlers are automatically reset to
  3919.       SIG_DFL when the signal handler gets called.  On such systems,
  3920.       you have to put "signal(SIGCHILD, catcher_func)" (where
  3921.       "catcher_func" is the name of the handler function) as the first
  3922.       thing in the signal handler, so that it gets reset.
  3923.       Unfortunately, there is a race condition which may cause you to
  3924.       get a SIGCHLD signal and have it ignored between the time your
  3925.       handler gets called and the time you reset the signal.
  3926.       Fortunately, newer implementations of signal() don't reset the
  3927.       handler to SIG_DFL when the handler function is called.  To get
  3928.       around this problem, on systems that do not have wait3() but do
  3929.       have SIGCLD, you need to reset the signal handler with a call to
  3930.       signal() after doing at least one wait() within the handler, each
  3931.       time it is called.
  3932.  
  3933.       The summary of all this is that on systems that have wait3(), you
  3934.       should use that and your signal handler should loop, and on
  3935.       systems that don't, you should have one call to wait() per
  3936.       invocation of the signal handler.
  3937.  
  3938.       One more thing -- if you don't want to go through all of this
  3939.       trouble, there is a portable way to avoid this problem, although
  3940.       it is somewhat less efficient.  Your parent process should fork,
  3941.       and then wait right there and then for the child process to
  3942.       terminate.  The child process then forks again, giving you a
  3943.       child and a grandchild.  The child exits immediately (and hence
  3944.       the parent waiting for it notices its death and continues to
  3945.       work), and the grandchild does whatever the child was originally
  3946.       supposed to.  Since its parent died, it is inherited by init,
  3947.       which will do whatever waiting is needed.  This method is
  3948.       inefficient because it requires an extra fork, but is pretty much
  3949.       completely portable.
  3950.  
  3951. 3.14) How do I get lines from a pipe as they are written instead of only in
  3952.       larger blocks.
  3953.  
  3954.       From: jik@pit-manager.MIT.Edu (Jonathan I. Kamens)
  3955.       Date: Sun, 16 Feb 92 20:59:28 -0500
  3956.  
  3957.       The stdio library does buffering differently depending on whether
  3958.       it thinks it's running on a tty.  If it thinks it's on a tty, it
  3959.       does buffering on a per-line basis; if not, it uses a larger
  3960.       buffer than one line.
  3961.  
  3962.       If you have the source code to the client whose buffering you
  3963.       want to disable, you can use setbuf() or setvbuf() to change the
  3964.       buffering.
  3965.  
  3966.       If not, the best you can do is try to convince the program that
  3967.       it's running on a tty by running it under a pty, e.g. by using
  3968.       the "pty" program mentioned in question 3.9.
  3969.  
  3970. -- 
  3971. Ted Timar - tmatimar@empress.com
  3972. Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3
  3973.  
  3974. -----------------------------
  3975.  
  3976. From: Ted M A Timar <tmatimar@empress.com>
  3977. Subject: Frequently Asked Questions about Unix (5/7) [Biweekly posting]
  3978. Date: 20 Nov 92 06:00:52 GMT
  3979. Expires: 18 Dec 1992 06:00:22 GMT
  3980. Followup-To: comp.unix.questions
  3981. Approved: news-answers-request@MIT.Edu
  3982. Supersedes: <unix-faq/part5_721029617@athena.mit.edu>
  3983. NNTP-Posting-Host: pit-manager.mit.edu
  3984. X-Last-Updated: 1992/10/21
  3985. To:       info-unix@sem.brl.mil
  3986.  
  3987. Archive-name: unix-faq/part5
  3988. Version: $Id: part5,v 2.0 92/10/20 12:07:13 tmatimar Exp $
  3989.  
  3990. These seven articles contain the answers to some Frequently Asked
  3991. Questions often seen in comp.unix.questions and comp.unix.shell.
  3992. Please don't ask these questions again, they've been answered plenty
  3993. of times already - and please don't flame someone just because they may
  3994. not have read this particular posting.  Thank you.
  3995.  
  3996. These articles are divided approximately as follows:
  3997.  
  3998.       1.*) General questions.
  3999.       2.*) Relatively basic questions, likely to be asked by beginners.
  4000.       3.*) Intermediate questions.
  4001.       4.*) Advanced questions, likely to be asked by people who thought
  4002.        they already knew all of the answers.
  4003.       5.*) Questions pertaining to the various shells, and the differences.
  4004.       6.*) An overview of Unix variants.
  4005.       7.*) An comparison of configuration management systems (RCS, SCCS).
  4006.  
  4007. This article includes answers to:
  4008.  
  4009.       5.1)  Can shells be classified into categories?
  4010.       5.2)  How do I "include" one shell script from within another
  4011.             shell script?
  4012.       5.3)  Do all shells have aliases?  Is there something else that
  4013.             can be used?
  4014.       5.4)  How are shell variables assigned?
  4015.       5.5)  How can I tell if I am running an interactive shell?
  4016.       5.6)  What "dot" files do the various shells use?
  4017.       5.7)  I would like to know more about the differences between the
  4018.             various shells.  Is this information available some place?
  4019.  
  4020. If you're looking for the answer to, say, question 5.5, and want to skip
  4021. everything else, you can search ahead for the regular expression "^5.5)".
  4022.  
  4023. While these are all legitimate questions, they seem to crop up in
  4024. comp.unix.questions or comp.unix.shell on an annual basis, usually
  4025. followed by plenty of replies (only some of which are correct) and then
  4026. a period of griping about how the same questions keep coming up.  You
  4027. may also like to read the monthly article "Answers to Frequently Asked
  4028. Questions" in the newsgroup "news.announce.newusers", which will tell
  4029. you what "UNIX" stands for.
  4030.  
  4031. With the variety of Unix systems in the world, it's hard to guarantee
  4032. that these answers will work everywhere.  Read your local manual pages
  4033. before trying anything suggested here.  If you have suggestions or
  4034. corrections for any of these answers, please send them to to
  4035. tmatimar@empress.com.
  4036.  
  4037. 5.1)  Can shells be classified into categories?
  4038.  
  4039.       From: wicks@dcdmjw.fnal.gov (Matthew Wicks)
  4040.       Date: Wed, 7 Oct 92 14:28:18 -0500
  4041.  
  4042.       In general there are two main class of shells.  The first class
  4043.       are those shells derived from the Bourne shell which includes sh,
  4044.       ksh, bash, and zsh.  The second class are those shells derived
  4045.       from C shell and include csh and tcsh.  In addition there is rc
  4046.       which most people consider to be in a "class by itself" although
  4047.       some people might argue that rc belongs in the Bourne shell class.
  4048.  
  4049.       With the classification above, using care, it is possible to
  4050.       write scripts that will work for all the shells from the Bourne
  4051.       shell category, and write other scripts that will work for all of
  4052.       the shells from the C shell category.
  4053.  
  4054. 5.2)  How do I "include" one shell script from within another shell script?
  4055.  
  4056.       From: wicks@dcdmjw.fnal.gov (Matthew Wicks)
  4057.       Date: Wed, 7 Oct 92 14:28:18 -0500
  4058.  
  4059.       All of the shells from the Bourne shell category (including rc)
  4060.       use the "." command.  All of the shells from the C shell category
  4061.       use "source".
  4062.  
  4063. 5.3)  Do all shells have aliases?  Is there something else that can be used?
  4064.  
  4065.       From: wicks@dcdmjw.fnal.gov (Matthew Wicks)
  4066.       Date: Wed, 7 Oct 92 14:28:18 -0500
  4067.  
  4068.       All of the major shells other than sh have aliases, but they
  4069.       don't all work the same way.  For example, some don't except
  4070.       arguments.
  4071.       
  4072.       Although not strictly equivalent, shell functions (which exist in
  4073.       all shells from the Bourne shell category) have almost the same
  4074.       functionality of aliases.  Shell functions can do things that
  4075.       aliases can't do.
  4076.       
  4077.       Use unalias to remove aliases and unset to remove functions.
  4078.  
  4079. 5.4)  How are shell variables assigned?
  4080.  
  4081.       From: wicks@dcdmjw.fnal.gov (Matthew Wicks)
  4082.       Date: Wed, 7 Oct 92 14:28:18 -0500
  4083.  
  4084.       The shells from the C shell category use "set variable=value" for
  4085.       variables local to the shell and "setenv variable value" for
  4086.       environment variables.  To get rid of variables in these shells
  4087.       use unset and unsetenv.  The shells from the Bourne shell
  4088.       category use "variable=value" and may require an "export
  4089.       VARIABLE_NAME" to place the variable into the environment.  To
  4090.       get rid of the variables use unset.
  4091.  
  4092. 5.5)  How can I tell if I am running an interactive shell?
  4093.  
  4094.       From: wicks@dcdmjw.fnal.gov (Matthew Wicks)
  4095.       Date: Wed, 7 Oct 92 14:28:18 -0500
  4096.  
  4097.       In the Bourne shell category look for the variable $PROMPT.  In
  4098.       the C shell category, look for the variable $prompt.
  4099.  
  4100. 5.6)  What "dot" files do the various shells use?
  4101.  
  4102.       From: wicks@dcdmjw.fnal.gov (Matthew Wicks)
  4103.       Date: Wed, 7 Oct 92 14:28:18 -0500
  4104.  
  4105.       Although this may not be a complete listing, this provides the
  4106.       majority of information.
  4107.  
  4108.       csh
  4109.       Some versions have system-wide .cshrc and .login files.  Every
  4110.       version puts them in different places.
  4111.  
  4112.       Start-up (in this order):
  4113.           .cshrc   - always.
  4114.           .login   - login shells.
  4115.  
  4116.       Upon termination:
  4117.               .logout  - login shells.
  4118.  
  4119.       Others:
  4120.           .history - saves the history (based on $savehist).
  4121.  
  4122.       tcsh
  4123.       Start-up (in this order):
  4124.           /etc/csh.cshrc - always.
  4125.           /etc/csh.login - login shells.
  4126.           .tcshrc        - always.
  4127.           .cshrc         - if no .tcshrc was present.
  4128.           .login         - login shells
  4129.  
  4130.       Upon termination:
  4131.               .logout        - login shells.
  4132.  
  4133.       Others:
  4134.           .history       - saves the history (based on $savehist).
  4135.           .cshdirs       - saves the directory stack.
  4136.  
  4137.       sh
  4138.       Start-up (in this order):
  4139.           /etc/profile - login shells.
  4140.           .profile     - login shells.
  4141.  
  4142.       Upon termination:
  4143.           any command (or script) specified using the command:
  4144.          trap "command" 0
  4145.  
  4146.       ksh
  4147.       Start-up (in this order):
  4148.           /etc/profile - login shells.
  4149.           .profile     - login shells.
  4150.           $ENV         - always, if it is set.
  4151.  
  4152.       Upon termination:
  4153.           any command (or script) specified using the command:
  4154.          trap "command" 0
  4155.  
  4156.       bash
  4157.       Start-up (in this order):
  4158.               /etc/profile  - login shells.
  4159.               .bash_profile - login shells.
  4160.               .bashrc       - interactive shells.
  4161.  
  4162.       Others:
  4163.               .inputrc      - Readline initialization.
  4164.  
  4165.       zsh
  4166.       Start-up (in this order):
  4167.               .zshenv   - always, unless -f is specified.
  4168.               .zprofile - login shells.
  4169.               .zshrc    - interactive shells, unless -f is specified.
  4170.               .zlogin   - login shells.
  4171.  
  4172.       Upon termination:
  4173.               .zlogout  - login shells.
  4174.  
  4175.       rc
  4176.       Start-up:
  4177.               .rcrc - login shells
  4178.  
  4179. 5.7)  I would like to know more about the differences between the
  4180.       various shells.  Is this information available some place?
  4181.  
  4182.       From: wicks@dcdmjw.fnal.gov (Matthew Wicks)
  4183.       Date: Wed, 7 Oct 92 14:28:18 -0500
  4184.  
  4185.       A very detailed comparison of sh, csh, tcsh, ksh, bash, zsh, and
  4186.       rc is available via anon.  ftp in several places:
  4187.  
  4188.       cs.uwp.edu (131.210.1.4):pub/vi/shell-100.BetaA.Z
  4189.       alf.uib.no (129.177.30.3):pub/lpf/misc/shell-100.BetaA.Z
  4190.       utsun.s.u-tokyo.ac.jp (133.11.11.11):misc/vi/shell-100.BetaA.Z
  4191.  
  4192.       This file compares the flags, the programming syntax,
  4193.       input/output redirection, and parameters/shell environment
  4194.       variables.  It doesn't discuss what dot files are used and the
  4195.       inheritance for environment variables and functions.
  4196.  
  4197. -- 
  4198. Ted Timar - tmatimar@empress.com
  4199. Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3
  4200.  
  4201. -----------------------------
  4202.  
  4203. From: Ted M A Timar <tmatimar@empress.com>
  4204. Subject: Frequently Asked Questions about Unix (7/7) [Biweekly posting]
  4205. Date: 20 Nov 92 06:00:54 GMT
  4206. Expires: 18 Dec 1992 06:00:22 GMT
  4207. Followup-To: comp.unix.questions
  4208. Approved: news-answers-request@MIT.Edu
  4209. Supersedes: <unix-faq/part7_721029617@athena.mit.edu>
  4210. NNTP-Posting-Host: pit-manager.mit.edu
  4211. X-Last-Updated: 1992/10/21
  4212. To:       info-unix@sem.brl.mil
  4213.  
  4214. Archive-name: unix-faq/part7
  4215. Version: $Id: part7,v 2.0 92/10/20 12:07:46 tmatimar Exp $
  4216.  
  4217. These seven articles contain the answers to some Frequently Asked
  4218. Questions often seen in comp.unix.questions and comp.unix.shell.
  4219. Please don't ask these questions again, they've been answered plenty
  4220. of times already - and please don't flame someone just because they may
  4221. not have read this particular posting.  Thank you.
  4222.  
  4223. These articles are divided approximately as follows:
  4224.  
  4225.       1.*) General questions.
  4226.       2.*) Relatively basic questions, likely to be asked by beginners.
  4227.       3.*) Intermediate questions.
  4228.       4.*) Advanced questions, likely to be asked by people who thought
  4229.        they already knew all of the answers.
  4230.       5.*) Questions pertaining to the various shells, and the differences.
  4231.       6.*) An overview of Unix variants.
  4232.       7.*) An comparison of configuration management systems (RCS, SCCS).
  4233.  
  4234. This article includes answers to:
  4235.  
  4236.       7.1)  RCS vs SCCS:  Introduction
  4237.       7.2)  RCS vs SCCS:  How do the interfaces compare?
  4238.       7.3)  RCS vs SCCS:  What's in a Revision File?
  4239.       7.4)  RCS vs SCCS:  What are the keywords?
  4240.       7.5)  What's an RCS symbolic name?
  4241.       7.6)  RCS vs SCCS:  How do they compare for performance?
  4242.       7.7)  RCS vs SCCS:  Version Identification.
  4243.       7.8)  RCS vs SCCS:  How do they handle with problems?
  4244.       7.9)  RCS vs SCCS:  Conversion.
  4245.       7.10) RCS vs SCCS:  Support
  4246.       7.11) RCS vs SCCS:  Command Comparison
  4247.       7.12) RCS vs SCCS:  Acknowledgements
  4248.       7.13) Can I get more information on configuration management systems?
  4249.  
  4250. If you're looking for the answer to, say, question 7.5, and want to skip
  4251. everything else, you can search ahead for the regular expression "^7.5)".
  4252.  
  4253. While these are all legitimate questions, they seem to crop up in
  4254. comp.unix.questions or comp.unix.shell on an annual basis, usually
  4255. followed by plenty of replies (only some of which are correct) and then
  4256. a period of griping about how the same questions keep coming up.  You
  4257. may also like to read the monthly article "Answers to Frequently Asked
  4258. Questions" in the newsgroup "news.announce.newusers", which will tell
  4259. you what "UNIX" stands for.
  4260.  
  4261. With the variety of Unix systems in the world, it's hard to guarantee
  4262. that these answers will work everywhere.  Read your local manual pages
  4263. before trying anything suggested here.  If you have suggestions or
  4264. corrections for any of these answers, please send them to to
  4265. tmatimar@empress.com.
  4266.  
  4267. 7.1)  RCS vs SCCS:  Introduction
  4268.  
  4269.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4270.       From: Bill Wohler <wohler@sap-ag.de>
  4271.  
  4272.       The majority of the replies (in a recent poll) were in favor of
  4273.       RCS, a few for SCCS, and a few suggested alternatives such as CVS.
  4274.  
  4275.       Functionally RCS and SCCS are practically equal, with RCS having
  4276.       a bit more features since it continues to be updated.
  4277.  
  4278.       Note that RCS learned from the mistakes of SCCS...
  4279.  
  4280. 7.2)  RCS vs SCCS:  How do the interfaces compare?
  4281.  
  4282.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4283.       From: Bill Wohler <wohler@sap-ag.de>
  4284.  
  4285.       RCS has an easier interface for first time users.  There are less
  4286.       commands, it is more intuitive and consistent, and it provides
  4287.       more useful arguments.
  4288.  
  4289.       Branches have to be specifically created in SCCS.  In RCS, they
  4290.       are checked in as any other version.
  4291.  
  4292. 7.3)  RCS vs SCCS:  What's in a Revision File?
  4293.  
  4294.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4295.       From: Bill Wohler <wohler@sap-ag.de>
  4296.  
  4297.       RCS keeps history in files with a ",v" suffix.  SCCS keeps
  4298.       history in files with a "s." prefix.
  4299.  
  4300.       RCS looks for RCS files automatically in the current directory or
  4301.       in a RCS subdirectory, or you can specify an alternate RCS file.
  4302.       The sccs front end to SCCS always uses the SCCS directory.  If
  4303.       you don't use the sccs front end, you must specify the full SCCS
  4304.       filename.
  4305.  
  4306.       RCS stores its revisions by holding a copy of the latest version
  4307.       and storing backward deltas.  SCCS uses a "merged delta"
  4308.       concept.
  4309.  
  4310.       All RCS activity takes place within a single RCS file.  SCCS
  4311.       maintains several files.  This can be messy and confusing.
  4312.  
  4313.       Editing either RCS or SCCS files is a bad idea because mistakes
  4314.       are so easy to make and so fatal to the history of the file.
  4315.       Revision information is easy to edit in both types, whereas one
  4316.       would not want to edit the actual text of a version in RCS.  If
  4317.       you edit an SCCS file, you will have to recalculate the checksum
  4318.       using the admin program.
  4319.  
  4320. 7.4)  RCS vs SCCS:  What are the keywords?
  4321.  
  4322.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4323.       From: Bill Wohler <wohler@sap-ag.de>
  4324.  
  4325.       RCS and SCCS use different keywords that are expanded in the
  4326.       text.  For SCCS the keyword "%I%" is replaced with the revision
  4327.       number if the file is checked out for reading.
  4328.  
  4329.       The RCS keywords are easier to remember, but keyword expansion is
  4330.       more easily customized in SCCS.
  4331.  
  4332.       In SCCS, keywords are expanded on a read-only get.  If a version
  4333.       with expanded keywords is copied into a file that will be
  4334.       deltaed, the keywords will be lost and the version information in
  4335.       the file will not be updated.  On the other hand, RCS retains the
  4336.       keywords when they are expanded so this is avoided.
  4337.  
  4338. 7.5)  What's an RCS symbolic name?
  4339.  
  4340.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4341.       From: Bill Wohler <wohler@sap-ag.de>
  4342.  
  4343.       RCS allows you treat a set of files as a family of files while
  4344.       SCCS is meant primarily for keeping the revision history of
  4345.       files.
  4346.  
  4347.       RCS accomplishes that with symbolic names: you can mark all the
  4348.       source files associated with an application version with `rcs
  4349.       -n', and then easily retrieve them later as a cohesive unit.  In
  4350.       SCCS you would have to do this by writing a script to write or
  4351.       read all file names and versions to or from a file.
  4352.  
  4353. 7.6)  RCS vs SCCS:  How do they compare for performance?
  4354.  
  4355.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4356.       From: Bill Wohler <wohler@sap-ag.de>
  4357.  
  4358.       Since RCS stores the latest version in full, it is much faster in
  4359.       retrieving the latest version.  After RCS version 5.6, it is also
  4360.       faster than SCCS in retrieving older versions.
  4361.  
  4362. 7.7)  RCS vs SCCS:  Version Identification.
  4363.  
  4364.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4365.       From: Bill Wohler <wohler@sap-ag.de>
  4366.  
  4367.       SCCS is able to determine when a specific line of code was added
  4368.       to a system.
  4369.  
  4370. 7.8)  RCS vs SCCS:  How do they handle with problems?
  4371.  
  4372.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4373.       From: Bill Wohler <wohler@sap-ag.de>
  4374.  
  4375.       If you are missing the sccs or rcs tools, or the RCS or SCCS file
  4376.       is corrupt and the tools don't work on it, you can still retrieve
  4377.       the latest version in RCS.  Not true with SCCS.
  4378.  
  4379. 7.9)  RCS vs SCCS:  Conversion.
  4380.  
  4381.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4382.       From: Bill Wohler <wohler@sap-ag.de>
  4383.  
  4384.       RCS provides a program to convert from SCCS to RCS.  One would
  4385.       have to write his own program to convert from RCS to SCCS.
  4386.  
  4387. 7.10) RCS vs SCCS:  Support
  4388.  
  4389.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4390.       From: Bill Wohler <wohler@sap-ag.de>
  4391.  
  4392.       SCCS is supported by AT&T.  RCS is supported by the Free Software
  4393.       Foundation.  Therefore RCS runs on many more platforms, including
  4394.       PCs.
  4395.  
  4396.       Most make programs recognize SCCS's "s."  prefix while GNU make
  4397.       is one of the few that handles RCS's ",v" suffix.
  4398.  
  4399.       Some tar programs have a -F option that ignores either RCS
  4400.       directories, or SCCS directories or both.
  4401.  
  4402. 7.11) RCS vs SCCS:  Command Comparison
  4403.  
  4404.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4405.       From: Bill Wohler <wohler@sap-ag.de>
  4406.  
  4407.       SCCS                        RCS                   Explanation
  4408.       ====                        ===                   ===========
  4409.  
  4410.       sccs admin -i -nfile file   ci file               Checks in the file
  4411.                                                         for the first time,
  4412.                                                         creating the revision
  4413.                                                         history file.
  4414.  
  4415.       sccs get file               co file               Check out a file for
  4416.                                                         reading.
  4417.  
  4418.       sccs edit file              co -l file            Check out a file for
  4419.                                                         modification.
  4420.  
  4421.       sccs delta file             ci file               Check in a file
  4422.                                                         previously locked.
  4423.  
  4424.       what file                   ident file            Print keyword
  4425.                                                         information.
  4426.  
  4427.       sccs prs file               rlog file             Print a history of
  4428.                                                         the file.
  4429.  
  4430.       sccs sccsdiff -rx -ry file  rcsdiff -rx -ry file  Compare two
  4431.                                                         revisions.
  4432.  
  4433.       sccs diffs file             rcsdiff file          Compare current with
  4434.                                                         last revision.
  4435.  
  4436.       sccs edit -ix-y file        rcsmerge -rx-y file   Merge changes between
  4437.                                                         two versions into
  4438.                                                         file.
  4439.  
  4440.       ???                         rcs -l file           Lock the latest
  4441.                                                         revision.
  4442.  
  4443.       ???                         rcs -u file           Unlock the latest
  4444.                                                         revision.  Possible
  4445.                                                         to break another's 
  4446.                                                         lock, but mail is
  4447.                                                         sent to the other
  4448.                                                         user explaining why.
  4449.  
  4450. 7.12) RCS vs SCCS:  Acknowledgements
  4451.  
  4452.       Date: Sat, 10 Oct 92 19:34:39 +0200
  4453.       From: Bill Wohler <wohler@sap-ag.de>
  4454.  
  4455.       I would like to thank the following persons for contributing to
  4456.       these articles.  I'd like to add your name to the list--please
  4457.       send comments or more references to Bill Wohler <wohler@sap-ag.de>.
  4458.  
  4459.     Karl Vogel <vogel@c-17igp.wpafb.af.mil>
  4460.     Mark Runyan <runyan@hpcuhc.cup.hp.com>
  4461.     Paul Eggert <eggert@twinsun.com>
  4462.     Greg Henderson <henders@infonode.ingr.com>
  4463.     Dave Goldberg <dsg@mbunix.mitre.org>
  4464.     Rob Kurver <rob@pact.nl>
  4465.     Raymond Chen <rjc@math.princeton.edu>
  4466.     Dwight <dwight@s1.gov>
  4467.  
  4468. 7.13) Can I get more information on configuration management systems?
  4469.  
  4470.       Date: Thu Oct 15 10:27:47 EDT 1992
  4471.       From: Ted Timar <tmatimar@empress.com>
  4472.  
  4473.       Bill Wohler, who compiled all of the information in this part of
  4474.       the FAQ, has compiled much more information.  This information is
  4475.       available for ftp from ftp.wg.omron.co.jp (133.210.4.4) under
  4476.       "pub/unix-faq/docs/rev-ctl-sys".
  4477.  
  4478. -----------------------------
  4479.  
  4480. From: Ted M A Timar <tmatimar@empress.com>
  4481. Subject: Frequently Asked Questions about Unix (6/7) [Biweekly posting]
  4482. Date: 20 Nov 92 06:00:56 GMT
  4483. Expires: 18 Dec 1992 06:00:22 GMT
  4484. Followup-To: comp.unix.questions
  4485. Approved: news-answers-request@MIT.Edu
  4486. Supersedes: <unix-faq/part6_721029617@athena.mit.edu>
  4487. NNTP-Posting-Host: pit-manager.mit.edu
  4488. X-Last-Updated: 1992/10/21
  4489. To:       info-unix@sem.brl.mil
  4490.  
  4491. Archive-name: unix-faq/part6
  4492. Version: $Id: part6,v 2.0 92/10/20 12:07:30 tmatimar Exp $
  4493.  
  4494. These seven articles contain the answers to some Frequently Asked
  4495. Questions often seen in comp.unix.questions and comp.unix.shell.
  4496. Please don't ask these questions again, they've been answered plenty
  4497. of times already - and please don't flame someone just because they may
  4498. not have read this particular posting.  Thank you.
  4499.  
  4500. These articles are divided approximately as follows:
  4501.  
  4502.       1.*) General questions.
  4503.       2.*) Relatively basic questions, likely to be asked by beginners.
  4504.       3.*) Intermediate questions.
  4505.       4.*) Advanced questions, likely to be asked by people who thought
  4506.        they already knew all of the answers.
  4507.       5.*) Questions pertaining to the various shells, and the differences.
  4508.       6.*) An overview of Unix variants.
  4509.       7.*) An comparison of configuration management systems (RCS, SCCS).
  4510.  
  4511. This article includes answers to:
  4512.  
  4513.       6.1)  Disclaimer and introduction.
  4514.       6.2)  A very brief look at Unix history.
  4515.       6.3)  Main Unix flavors.
  4516.       6.4)  Unix Standards.
  4517.       6.5)  Identifying your Unix flavor.
  4518.       6.6)  Brief notes on some well-known (commercial/PD) Unices.
  4519.       6.7)  Real-time Unices.
  4520.       6.8)  Unix glossary.
  4521.       6.9)  Acknowledgements.
  4522.  
  4523. If you're looking for the answer to, say, question 6.5, and want to skip
  4524. everything else, you can search ahead for the regular expression "^6.5)".
  4525.  
  4526. While these are all legitimate questions, they seem to crop up in
  4527. comp.unix.questions or comp.unix.shell on an annual basis, usually
  4528. followed by plenty of replies (only some of which are correct) and then
  4529. a period of griping about how the same questions keep coming up.  You
  4530. may also like to read the monthly article "Answers to Frequently Asked
  4531. Questions" in the newsgroup "news.announce.newusers", which will tell
  4532. you what "UNIX" stands for.
  4533.  
  4534. With the variety of Unix systems in the world, it's hard to guarantee
  4535. that these answers will work everywhere.  Read your local manual pages
  4536. before trying anything suggested here.  If you have suggestions or
  4537. corrections for any of these answers, please send them to to
  4538. tmatimar@empress.com.
  4539.  
  4540. 6.1)  Disclaimer and introduction.
  4541.  
  4542.       From: "Pierre (P.) Lewis" <lew@bnr.ca>
  4543.       Date: Sun, 11 Oct 1992 15:29:00 +0000
  4544.       Version: 2.0
  4545.  
  4546.       The following is offered with no guarantee as to accuracy or
  4547.       completeness.  I have done what I can in the time available and
  4548.       it still is very much work in progress.  I hope to keep improving
  4549.       this summary.  Comments welcome:  lew@bnr.ca.  Acknowledgements
  4550.       at the end.
  4551.  
  4552.       First a short definition.  By Unix we mean an operating system
  4553.       typically written in C, with a hierarchical file system,
  4554.       integration of file and device I/O, whose system call interface
  4555.       includes services such as fork(), pipe(), and whose user
  4556.       interface includes tools such as cc, troff, grep, awk, and a
  4557.       choice of shell.  Note that UNIX is a registered trademark of USL
  4558.       (AT&T), but will be used here in its generic sense.
  4559.  
  4560.       Most Unices (the more common plural form) are derived more or
  4561.       less directly from AT&T code (some code from the first C version
  4562.       is presumably still left in most), but there are also clones
  4563.       (i.e. Unix-compatible systems with no AT&T code).
  4564.  
  4565.       In addition, there are also Unix-like environments (e.g. VOS)
  4566.       sitting on top of other OSs, and OSs inspired from Unix (yes,
  4567.       even DOS!).  These are not covered here.  Little on real-time
  4568.       Unices yet (although more is planned).
  4569.  
  4570.       Unix comes in an incredible variety of flavors.  This is to a
  4571.       large extent due to availability of sources and the ease of
  4572.       porting and modifying Unix.  Typically, a vendor of Unix will
  4573.       start with one basic flavor (see below), take ideas/code from the
  4574.       other major flavor, add and change many things, etc.  This
  4575.       results in yet another new Unix flavor.  Today, there are
  4576.       literally hundreds of Unices available, the closest thing to
  4577.       standard Unix being (by definition) System V.
  4578.  
  4579.       This answer was put together mostly from information on the net
  4580.       and email.  Some specific sources are also mentioned in the
  4581.       appropriate sections.
  4582.  
  4583. 6.2)  A very brief look at Unix history.
  4584.  
  4585.       From: "Pierre (P.) Lewis" <lew@bnr.ca>
  4586.       Date: Sun, 11 Oct 1992 15:29:00 +0000
  4587.       Version: 2.0
  4588.  
  4589.       Unix history goes back to 1969 and the famous "little-used PDP-7
  4590.       in a corner" on which Ken Thompson, Dennis Ritchie (the R in K&R)
  4591.       and others started work on what was to become Unix.  The name
  4592.       "Unix" was intended as a pun on Multics (and was written "Unics"
  4593.       at first -- UNiplexed Information and Computing System).
  4594.  
  4595.       For the first 10 years, Unix development was essentially confined
  4596.       to Bell Labs.  These initial versions were labeled "Version n" or
  4597.       "Nth Edition" (of the manuals), and were for DEC's PDP-11 (16
  4598.       bits) and later VAXen (32 bits).  Some significant versions
  4599.       include:
  4600.  
  4601.       V1 (1971):  1st Unix version, in assembler on a PDP-11/20.
  4602.      Included file system, fork(), roff, ed.  Was used as a text
  4603.      processing tool for preparation of patents.  Pipe() appeared
  4604.      first in V2!
  4605.  
  4606.       V4 (1973):  Rewritten in C, which is probably the most
  4607.      significant event in this OS's history: it means Unix can be
  4608.      ported to a new hardware in months, and changes are easy.  The
  4609.      C language was originally designed for the Unix operating
  4610.      system, and hence there is a strong synergy between C and Unix.
  4611.  
  4612.       V6 (1975):  First version of Unix widely available outside
  4613.      Bell Labs (esp.  in universities).  This was also the start of
  4614.      Unix diversity and popularity.  1.xBSD (PDP-11) was derived
  4615.      from this version.  J. Lions published "A commentary on the
  4616.      Unix Operating System" based on V6.
  4617.  
  4618.       V7 (1979):  For many, this is the "last true Unix", an
  4619.      "improvement over all preceding and following Unices"
  4620.      [Bourne].  It included full K&R C, uucp, Bourne shell.  V7 was
  4621.      ported to the VAX as 32V.  The V7 kernel was a mere 40
  4622.      Kbytes!
  4623.  
  4624.          Here (for reference) the system calls of V7:
  4625.         _exit, access, acct, alarm, brk, chdir, chmod, chown,
  4626.         chroot, close, creat, dup, dup2, exec*, exit, fork, fstat,
  4627.         ftime, getegid, geteuid, getgid, getpid, getuid, gtty,
  4628.         indir, ioctl, kill, link, lock, lseek, mknod, mount,
  4629.         mpxcall, nice, open, pause, phys, pipe, pkoff, pkon,
  4630.         profil, ptrace, read, sbrk, setgid, setuid, signal, stat,
  4631.         stime, stty, sync, tell, time, times, umask, umount,
  4632.         unlink, utime, wait, write.
  4633.  
  4634.       These Vn versions were developed by the Computer Research Group
  4635.       (CRG) of Bell Labs.  Another group, the Unix System Group (USG),
  4636.       was responsible for support.  A third group at Bell Labs was also
  4637.       involved in Unix development, the Programmer's WorkBench (PWB),
  4638.       to which we owe, for example, sccs, named pipes and other
  4639.       important ideas.  Both groups were merged into Unix System
  4640.       Development Lab in 1983.
  4641.  
  4642.       Work on Unix continued at Bell Labs in the 1980s.  The V series
  4643.       was further developed by the CRG (Stroustrup mentions V10 in the
  4644.       2nd edition of his book on C++), but we don't seem to hear much
  4645.       about this otherwise.  The company now responsible for Unix
  4646.       (System V) is called Unix System Laboratories (USL) and is
  4647.       majority-owned by AT&T.
  4648.  
  4649.       But much happened to Unix outside AT&T, especially at Berkeley
  4650.       (where the other major flavor comes from).  Vendors (esp. of
  4651.       workstations) also contributed much (e.g. Sun's NFS).
  4652.  
  4653.       The book "Life with Unix" by Don Libes and Sandy Ressler is
  4654.       fascinating reading for anyone interested in Unix, and covers a
  4655.       lot of the history, interactions, etc..  Much in the present
  4656.       section is summarized from this book.
  4657.  
  4658. 6.3)  Main Unix flavors.
  4659.  
  4660.       From: "Pierre (P.) Lewis" <lew@bnr.ca>
  4661.       Date: Sun, 11 Oct 1992 15:29:00 +0000
  4662.       Version: 2.0
  4663.  
  4664.       Until recently, there were basically two main flavors of Unix:
  4665.       System V (five) from AT&T, and the Berkeley Software Distribution
  4666.       (BSD).  SVR4 is essentially a merge of these two flavors.  End
  4667.       '91, OSF/1 from the Open Software Foundation was released (as a
  4668.       direct competitor to System V) and may (future will tell) change
  4669.       this picture.
  4670.  
  4671.       The following lists the main releases and features of System V,
  4672.       BSD and OSF/1.
  4673.  
  4674.       System V from AT&T.  Typical of Intel hardware.  Most often
  4675.      ported Unix, typically with BSD enhancements (csh, job
  4676.      control, termcap, curses, vi, symbolic links).  System V
  4677.      evolution is now overseen by Unix International (UI).  UI
  4678.      members include AT&T, Sun, ....
  4679.      Newsgroup: comp.unix.sysv[23]86.  Main releases:
  4680.  
  4681.          - System III (1982): first commercial Unix from AT&T
  4682.            - FIFOs (named pipes)  (later?)
  4683.  
  4684.          - System V (1983):
  4685.            - IPC package (shm, msg, sem)
  4686.  
  4687.          - SVR2 (1984):
  4688.            - shell functions (sh)
  4689.            - SVID (System V Interface Definition)
  4690.  
  4691.          - SVR3 (1986) for ? platforms:
  4692.            - STREAMS (inspired by V8), poll(), TLI (network software)
  4693.            - RFS
  4694.            - shared libs
  4695.            - SVID 2
  4696.            - demand paging (if hardware supports)
  4697.  
  4698.          - SVR3.2:
  4699.            - merge with Xenix (Intel 80386)
  4700.            - networking
  4701.  
  4702.          - SVR4 (1988), mainstream of Unix implementations, merge of
  4703.        System V, BSD, and SunOS.
  4704.            - From SVR3: sysadmin, terminal I/F, printer (from BSD?),
  4705.          RFS, STREAMS, uucp
  4706.            - From BSD: FFS, TCP/IP, sockets, select(), csh
  4707.            - From SunOS: NFS, OpenLook GUI, X11/NeWS, virtual memory
  4708.          subsystem with memory-mapped files, shared libraries
  4709.          (!= SVR3 ones?)
  4710.            - ksh
  4711.            - ANSI C
  4712.            - Internationalization (8-bit clean)
  4713.            - ABI (Application Binary Interface -- routines instead of traps)
  4714.            - POSIX, X/Open, SVID3
  4715.  
  4716.          - SVR4.1
  4717.            - async I/O (from SunOS?)
  4718.  
  4719.          - SVR4.2 (based on SVR4.1ES)
  4720.            - Veritas FS, ACLs
  4721.            - Dynamically loadable kernel modules
  4722.  
  4723.          - Future:
  4724.            - SVR4 MP (multiprocessor)
  4725.            - Use of Chorus microkernel?
  4726.  
  4727.       Berkeley Software Distribution (BSD).  Typical of VAXen, RISCs,
  4728.      many workstations.  More dynamic, research versions now than
  4729.      System V.  BSD is responsible for much of the popularity of
  4730.      Unix.  Most enhancements to Unix started here.  The group
  4731.      responsible at UCB (University of California at Berkeley) is
  4732.      the Computer System Research Group (CSRG).  They closed down
  4733.      in 1992.  Newsgroup: comp.unix.bsd.  Main releases:
  4734.  
  4735.          (much reorganized wrt dates and releases, hope it's converging)
  4736.  
  4737.          - 2.xBSD (1978) for PDP-11, still of significance? (2.11BSD
  4738.        was released in 1992!).
  4739.            - csh
  4740.  
  4741.          - 3BSD (1978):
  4742.            - virtual memory
  4743.  
  4744.          - 4.?BSD:
  4745.            - termcap, curses
  4746.            - vi
  4747.  
  4748.          - 4.0BSD (1980):
  4749.  
  4750.          - 4.1BSD (?): base of later AT&T CRG versions
  4751.            - job control
  4752.            - automatic kernel config
  4753.            - vfork()
  4754.  
  4755.          - 4.2BSD (1983):
  4756.            - TCP/IP, sockets, ethernet
  4757.            - UFS: long file names, symbolic links
  4758.            - new reliable signals (4.1 reliable signals now in SVR3)
  4759.            - select()
  4760.  
  4761.          - 4.3BSD (1986) for VAX, ?:
  4762.          - 4.3 Tahoe (1988): 4.3BSD with sources, support for Tahoe
  4763.        (32-bit supermini)
  4764.            - Fat FFS
  4765.            - New TCP algorithms
  4766.          - 4.3 Reno (1990) for VAX, Tahoe, HP 9000/300:
  4767.            - most of P1003.1
  4768.            - NFS (from Sun)
  4769.            - MFS (memory file system)
  4770.            - OSI: TP4, CLNP, ISODE's FTAM, VT and X.500;  SLIP
  4771.            - Kerberos
  4772.  
  4773.          - 4.4BSD (will we ever see it?) for HP 9000, Sparc, 386, DEC, Tahoe:
  4774.            - new FS organization, new process internals, new virtual
  4775.          memory based on Mach 2.5
  4776.            - POSIX compatibility
  4777.            - OSI (based on ISODE), X.25
  4778.  
  4779.       The Open Software Foundation (OSF) released its Unix called OSF/1
  4780.      end of 1991.  Still requires an SVR2 license.
  4781.      Compatible/compliant with SVID 2 (and 3 coming), POSIX,
  4782.      X/Open, etc..  OSF members include Apollo, Dec, HP, IBM, ....
  4783.  
  4784.          - OSF/1 (1991):
  4785.            - based on Mach 2.5 kernel
  4786.            - symmetric multiprocessing, parallelized kernel, threads
  4787.            - logical volumes, disk mirroring, UFS (native), S5 FS, NFS
  4788.            - enhanced security (B1 with some B2, B3; or C2), 4.3BSD admin
  4789.            - STREAMS, TLI/XTI, sockets
  4790.            - shared libs, dynamic loader (incl. kernel)
  4791.            - Motif GUI
  4792.  
  4793.          - Future:
  4794.            - OSF/1 MK (mikrokernel) based on Mach 3.0
  4795.  
  4796.       This list of major flavors should probably also include Xenix
  4797.       which has been the basis for many ports.  Derived from V7, S III
  4798.       and finally System V, it is similar externally but significantly
  4799.       changed internally (performance-tuned for micros).
  4800.  
  4801.  
  4802.       Two very good books describe the internals of the two main flavors.
  4803.       These are:
  4804.       - System V: "Design of the Unix Operating SYstem", M.J. Bach.
  4805.       - BSD: "Design and Implementation of the 4.3BSD Unix Operating System",
  4806.         Leffler, McKusick, Karels, Quaterman.
  4807.       For a good introduction to OSF/1 (not quite as technical as the
  4808.       previous two), see: "Guide to OSF/1, A Technical Synopsis",
  4809.       published by O'Reilly.  On SunOS, "Virtual Memory Architecture in
  4810.       SunOS" and "Shared Libraries in SunOS" in Summer 1989 USENIX
  4811.       Proceedings.
  4812.  
  4813.       A good set of articles on where Unix is going is "Unix Variants"
  4814.       in the Apr 92 issue of Unix Review.  Other good sources of
  4815.       information include the bsd-faq file, and many of the newsgroups
  4816.       mentioned in the text.
  4817.  
  4818. 6.4)  Unix Standards.
  4819.  
  4820.       From: "Pierre (P.) Lewis" <lew@bnr.ca>
  4821.       Date: Sun, 11 Oct 1992 15:29:00 +0000
  4822.       Version: 2.0
  4823.  
  4824.       This section briefly describes the more important standards
  4825.       relevant to Unix.
  4826.  
  4827.       - IEEE:
  4828.         - 802.x (LAN) standards (LLC, ethernet, token ring, token bus)
  4829.         - POSIX (ISO 9945?): Portable Operating System I/F (Unix, VMS
  4830.       and OS/2!) (only ? have been finalized at this point)
  4831.           - 1003.1:  library procedures (mostly system calls) -- roughly V7
  4832.                      except for signals and terminal I/F (1990)
  4833.           - 1003.2:  shell and utilities
  4834.           - 1003.3:  test methods and conformance
  4835.       - 1003.4:  real-time: binary semaphores, process memory
  4836.              locking, memory-mapped files, shared memory,
  4837.              priority scheduling, real-time signals, clocks and
  4838.              timers, IPC message passing, synchronized I/O,
  4839.              asynchronous I/O, real-time files
  4840.           - 1003.5:  Ada language bindings
  4841.           - 1003.6:  security
  4842.           - 1003.7:  system admin (incl. printing)
  4843.           - 1003.8:  transparent file access
  4844.           - 1003.9:  FORTRAN language bindings
  4845.           - 1003.10: super computing
  4846.           - 1003.12: protocol-independent I/Fs
  4847.           - 1003.13: real-time profiles
  4848.           - 1003.15: supercomputing batch I/Fs
  4849.           - 1003.16: C-language bindings (?)
  4850.           - 1003.17: directory services
  4851.           - 1003.19: FORTRAN 90 language bindings
  4852.  
  4853.       - X/Open (consortium of vendors):
  4854.         - X/Open Portability Guides (XPGn):
  4855.           - XPG2 (1987), strong SV influence
  4856.             Vol 1:  commands and utilities
  4857.             Vol 2:  system calls and libraries
  4858.             Vol 3:  terminal I/F (curses, termio), IPC (SV),
  4859.             internationalization
  4860.             Vol 4:  programming languages (C, COBOL!)
  4861.             Vol 5:  data management (ISAM, SQL)
  4862.           - XPG3 adds: ?
  4863.         - XOM series of interfaces:
  4864.           - XOM (X/Open Object Management) generic I/F mechanisms for
  4865.         following
  4866.           - XDS (X/Open Directory Service)
  4867.           - XMH (X/Open Mail ??)
  4868.           - XCM (X/Open Consolidated Management) (not yet approved?)
  4869.  
  4870.       - AT&T
  4871.         - System V Interface Definition (SVID)
  4872.           - SVID1 (1985, SVR2)
  4873.             Vol 1:  system calls and libraries (similar to XPG2.1)
  4874.           - SVID2 (1986, SVR3)
  4875.             Vol 1:  system calls and libraries (base, kernel extensions)
  4876.             Vol 2:  commands and utilities (base, advanced, admin, software
  4877.                     development), terminal I/F
  4878.             Vol 3:  terminal I/F (again), STREAMS and TLI, RFS
  4879.           - SVID3 (19??, SVR4) adds
  4880.             Vol 4:  ??  &c
  4881.         - APIs
  4882.           - Transport Library Interface (TLI)
  4883.           - ACSE/Presentation Library Interface (APLI)
  4884.  
  4885. 6.5)  Identifying your Unix flavor.
  4886.  
  4887.       From: "Pierre (P.) Lewis" <lew@bnr.ca>
  4888.       Date: Sun, 11 Oct 1992 15:29:00 +0000
  4889.       Version: 2.0
  4890.  
  4891.       This section lists a number of things you can look at in
  4892.       attempting to identify the base flavor of your Unix.  Given the
  4893.       significant exchange of code and ideas between the various
  4894.       flavors and the many changes made by vendors, any statement such
  4895.       as "this Unix is an SVR2" is at best a statistical statement
  4896.       (except for some SVRn ports).  Also many Unices offer most of
  4897.       both worlds (either mixed as in SunOS or strictly separated as in
  4898.       Apollo?).  So this section is perhaps not very useful...
  4899.  
  4900.       The list of features in previous sections can also help.  For
  4901.       example, if a system has a poll(2) but no select(2), it is highly
  4902.       probable that it is derived from SVR3.  Also the name of the OS
  4903.       can provide a clue, as well as the logon message (e.g.  SGI's
  4904.       "Irix SVR3.3.2") or the output of "uname -a" command.  Available
  4905.       commands can also provide hints but this is probably less
  4906.       reliable than kernel features.  For example, the type of terminal
  4907.       initialization (inittab or ttys) is a more reliable indicator
  4908.       than the print subsystem.
  4909.  
  4910.       Feature            Typical in SVRx          Typical in xBSD
  4911.  
  4912.       kernel name        /unix                    /vmunix
  4913.       terminal init      /etc/inittab             /etc/ttys (only getty to 4.3)
  4914.       boot init          /etc/rc.d directories    /etc/rc.* files
  4915.       mounted FSs        /etc/mnttab              /etc/mtab
  4916.       usual shell        sh, ksh                  csh, #! hack
  4917.       native FS          S5 (blk: 512-2K)         UFS (blk: 4K-8K)
  4918.                          file names <= 14 bytes   file names < 255 bytes
  4919.       groups             need newgrp(1)           automatic membership
  4920.                          SVR4: multiple groups
  4921.       print subsystem    lp, lpstat, cancel       lpr, lpq, lprm (lpd daemon) ??
  4922.       terminal control   termio, terminfo,        termios (sgtty before 4.3reno)
  4923.                          SVR4: termios (POSIX)    termcap
  4924.       job control        >= SVR4                  yes
  4925.       ps command         ps -ef                   ps -aux
  4926.       string fcns        memset, memcpy           bzero, bcopy
  4927.       process mapping    /proc  (SVR4)
  4928.  
  4929. 6.6)  Brief notes on some well-known (commercial/PD) Unices.
  4930.  
  4931.       From: "Pierre (P.) Lewis" <lew@bnr.ca>
  4932.       Date: Sun, 11 Oct 1992 15:29:00 +0000
  4933.       Version: 2.0
  4934.  
  4935.       (I am not at all satisfied with this section, unfortunately I
  4936.       have neither the time nor the documents to make it much better
  4937.       (wrt contents).  Should only list Unices known by a reasonably
  4938.       wide audience.  Small and non-US Unices welcome, e.g. Eurix.  In
  4939.       need of reformatting)
  4940.  
  4941.       This section lists (in alphabetical order) some of the better
  4942.       known Unices along with a brief description of their nature.
  4943.  
  4944.       AIX:  IBM's Unix, based on SVR2 (later up to SVR3.2?) with varying
  4945.      degrees of BSD extensions, for various hardwares.  Proprietary
  4946.      system admin (SMIT).  Both 850 and Latin-1 CPs.  Quite
  4947.      different from most Unices and among themselves.
  4948.      Newsgroup: comp.unix.aix.
  4949.          - 1.x (for 386 PS/2)
  4950.          - 2.x (for PC RTs)
  4951.          - 3.x (for RS/6000), paging kernel, logical volume manager, i18n;
  4952.            3.2 adds TLI/STREAMS
  4953.          - there is also a version for S/370 mainframes (as task under VM)
  4954.          Was to have been base for OSF/1 until Mach was chosen instead.
  4955.  
  4956.       AOS (IBM):  4.3BSD port to IBM PC RT (for educational institutes).
  4957.          Don't confuse with DG's proprietary OS of same name.
  4958.  
  4959.       Arix:  SV
  4960.  
  4961.       A/UX (Apple): SV with Berkeley enhancements, NFS, Mac GUI.  System 6
  4962.          (later System 7) runs as guest of A/UX (opposite of MachTen).
  4963.      Newsgroup: comp.unix.aux.
  4964.          - 2.0:  SVR2 with 4.2BSD, system 6 Mac applications.
  4965.          - 3.0 (1992): SVR2.2 with 4.3BSD, system 7 applications.
  4966.  
  4967.       BOS for Bull's DPX/2 (680x0)
  4968.          - V1 (1990): SVR3 with BSD extensions (FFS, select, sockets),
  4969.        symmetric MP, X11R3
  4970.          - V2 (1991): adds job control, disk mirroring, C2 security,
  4971.        DCE extensions
  4972.  
  4973.       386BSD: Jolitz's port of Net2 software.  Posix, 32-bit, still in alpha.
  4974.  
  4975.       BSD/386 (80386):  from BSDI, with source (augmented Net2 software)
  4976.          Newsgroup: comp.unix.bsd.
  4977.  
  4978.       Chorus/MiXV:  Unix SVR3.2 (SVR4) over Chorus nucleus, ABI/BCS.
  4979.  
  4980.       Coherent (80286):  Unix clone compatible with V7, some SVR2 (IPC).
  4981.          V4.0 is 32-bit.  Newsgroup: comp.os.coherent
  4982.  
  4983.       Consensys: SVR4
  4984.  
  4985.       CTIX: SV-based, from Convergent
  4986.  
  4987.       D-NIX:  SV
  4988.  
  4989.       DomainIX (Apollo):  dual Unix over Apollo Domain operating system
  4990.  
  4991.       DomainOS (Apollo):  BSD 4.2? with System V? (strict differentiation?)
  4992.          - 10.x
  4993.  
  4994.       DVIX (NT's DVS):  SVR2
  4995.  
  4996.       DYNIX (Sequent): 4.2BSD-based
  4997.  
  4998.       DYNIX/PTX: SVR3-based
  4999.  
  5000.       Esix (80386):  pure SVR4, X11, OpenLook (NeWS), Xview
  5001.  
  5002.       Eurix (80?86):  SVR3.2 (german?)
  5003.  
  5004.       FTX: Stratus fault-tolerant OS (68K or i860-i960 hardware)
  5005.  
  5006.       GNU Hurd (?):  vaporware from the Free Software Foundation (FSF):
  5007.      Unix emulator over Mach 3.0 kernel.  Many GNU tools are very
  5008.      popular (emacs) and used in the PD Unices.
  5009.  
  5010.       HP-UX (HP):  old from S III (SVRx), now SVR2 (4.2BSD?) with SV utilities
  5011.          (they have trouble making up their minds).
  5012.          - 6.5: SVR2
  5013.          - 7.0: SVR3.2, symlinks
  5014.          - 7.5
  5015.          - 8.0: BSD based? for HP-9000 CISC (300/400) and RISC (800/700)
  5016.  
  5017.       Interactive SVR3.2 (80x86): pure SVR3.  Interactive has been bought
  5018.          by Sun; will their system survive Solaris?
  5019.  
  5020.       Idris:  first Unix clone by Whitesmith.
  5021.          - 4D
  5022.  
  5023.       Irix (SGI):  SVR3.2, much BSD.  Newsgroup: comp.sys.sgi.
  5024.  
  5025.       Linux (80386):  PD Unix, SVish.  Available with sources.
  5026.          Newsgroup: comp.os.linux
  5027.  
  5028.       MachTen, Tenon Intersystems:  runs as a guest of System 6, no memory
  5029.          protection, 4.3BSD environment with TCP, NFS.
  5030.  
  5031.       MacMach (Mac II): 4.3BSD over Mach 3.0 microkernel, X11, Motif, GNU
  5032.          software, sources, experimental System 7 as Mach task.
  5033.  
  5034.       Mach386: from Mt Xinu.  Based on Mach 2.5, with 4.3BSD-Tahoe
  5035.          enhancements.  Also 2.6 MSD (Mach Source Distribution).
  5036.  
  5037.       Microport (80x86):  pure SVR4, X11, OpenLook GUI
  5038.  
  5039.       Minix (80x86, Atari, Amiga, Mac):  Unix clone compatible with V7.
  5040.          Sold with sources.  Being POSIXified (sp?).  Newsgroup: comp.os.minix.
  5041.  
  5042.       MipsOS:  SVish (RISC/OS, now dropped, was BSDish)
  5043.  
  5044.       more/BSD (VAX, HP 9000/300):  Mt Xinu's Unix, based on 4.3BSD-Tahoe.
  5045.          Newsgroup: comp.os.xinu?
  5046.  
  5047.       Net/2 tape (from Berkeley, 1991): BSD Unix, essentially compatible with
  5048.          4.3BSD, includes only sources free of AT&T code, no low-level code.
  5049.      See 386BSD and BSD/386 above.
  5050.  
  5051.       NextStep (Next):  BSD over Mach kernel, own GUI.  386 version coming?
  5052.          - 1.0
  5053.  
  5054.       NEWS-OS (Sony)
  5055.          - 3.2
  5056.  
  5057.       OSF/1 (DEC): DEC's port of OSF/1
  5058.  
  5059.       PC-IX (IBM 8086):  SV
  5060.  
  5061.       SCO Xenix (80x86):
  5062.  
  5063.       SCO Unix (80x86):  SVR3.2
  5064.  
  5065.       Solaris (Sparc, 80386):
  5066.          - 1.0:  essentially same as SunOS 4.1.1, with OpenWindows 2.0 and
  5067.            DeskSet utilities.
  5068.          - 1.0.1:  SunOS 4.1.2 with multiprocessing (kernel not multithreaded);
  5069.            not for 386
  5070.          - 2.0:  will be based on SVR4 (and have symmetric MP), will include
  5071.            support for 386;  with OpenWindows 3.0 (X11R4), DeskSet, ONC, NIS.
  5072.            Compilers unbundled!
  5073.  
  5074.       SunOS (680x0, Sparc, i386):  based on 4.3BSD, includes much from System V.
  5075.          Main Sun achievements: NFS (1984), SunView (1985), NeWS
  5076.      (1986, postscript imaging, now in OpenWindows), OpenLook GUI standard,
  5077.      OpenWindows (NeWS, X11, SunView!).  Newsgroup: comp.sys.sun.*.
  5078.          - 3.x:  SV IPC package, FIFOs
  5079.          - 4.0.3: lightweight processes, new virtual mem, shared libs
  5080.          - 4.1: STREAMS & TLI, 8-bit clean?, async I/O, ms-dos file system
  5081.          (continues as Solaris -- see above).
  5082.  
  5083.       UHC (80x86): pure SVR4, X11, Motif
  5084.  
  5085.       Ultrix (DEC):  based on 4.2BSD with much of 4.3.
  5086.          Newsgroup: comp.unix.ultrix.
  5087.          - 3.1, 4.0
  5088.  
  5089.       UNICOS (Cray):  Newsgroup: comp.unix.cray
  5090.          - 5.x, 6,x, 7.0
  5091.  
  5092.       UTEK (Tektronix)
  5093.          - 4.0
  5094.  
  5095.       Xenix (80x86):  1st Unix on Intel hardware, based on SVR2 (previously on
  5096.          S III and even V7).  Newsgroup: comp.unix.xenix.
  5097.  
  5098.       3B1 (680x0): SV-based, done by Convergent for AT&T.
  5099.      Newsgroup: comp.sys.3b1.
  5100.  
  5101. 6.7)  Real-time Unices.
  5102.  
  5103.       From: "Pierre (P.) Lewis" <lew@bnr.ca>
  5104.       Date: Sun, 11 Oct 1992 15:29:00 +0000
  5105.       Version: 2.0
  5106.  
  5107.       This information is fragmentary.  I doubt all of following are Unices --
  5108.          input is welcome.
  5109.  
  5110.       RTU (Concurrent), for 68K boxes
  5111.  
  5112.       Stellix (Stardent); it's Unix, but is it real-time?
  5113.  
  5114.       Velocity (Ready Systems):
  5115.  
  5116.       VxWorks (Wind River Systems):  BSDish, no termcap.
  5117.          Newsgroup: comp.os.vxworks.
  5118.  
  5119.       pSOS??
  5120.  
  5121. 6.8)  Unix glossary.
  5122.  
  5123.       From: "Pierre (P.) Lewis" <lew@bnr.ca>
  5124.       Date: Sun, 11 Oct 1992 15:29:00 +0000
  5125.       Version: 2.0
  5126.  
  5127.       This section provides short definitions of various concepts and
  5128.       components of (or related to) Unix systems.
  5129.  
  5130.       Chorus: message-passing microkernel, may form basis for a future release
  5131.          of SV.  Chorus already have SVR4 running on top (binary-compatible).
  5132.  
  5133.       DCE (Distributed Computing Environment, from OSF): Includes RPC (Apollo's
  5134.          NCS), directory service (local based on DNS, global on X.500), time,
  5135.          security, and threads services, DFS (distrib. file system), ....
  5136.          OS-independent.
  5137.  
  5138.       DME (Distributed Management Environment, from OSF):  future.
  5139.  
  5140.       FFS (Fast File System): alias for UFS (BSD name)
  5141.  
  5142.       Mach: modern kernels from CMU (Carnegie Mellon University) on which many
  5143.          Unices and other OSs are based (e.g. OSF/1, MacMach, ...):
  5144.          - 2.5: monolithic kernel with 4.2BSD
  5145.          - 3.0: microkernel with BSD Unix server in user space (and other OSs,
  5146.        e.g. MS-DOS)
  5147.          Newsgroup: comp.os.mach
  5148.  
  5149.       MFS: Memory File System
  5150.  
  5151.       NFS (Network File System):  contributed by Sun to BSD, stateless server
  5152.  
  5153.       ONC (Open Network Computing): from Sun(?), includes RPC, name service
  5154.      (NIS aka YP), NFS, ... (found in many Unices, other OSs).
  5155.  
  5156.       RFS (Remote File System):  SV, stateful server, incompatible with NFS
  5157.  
  5158.       RPC (Remote Procedure Call): high-level IPC (inter-process communication)
  5159.          mechanism.  Two flavors.
  5160.          - ONC: Over TCP or UDP (later OSI), uses XDR to encode data.
  5161.          - DCE: has a different RPC mechanism (based on Apollo's NCS)
  5162.  
  5163.       S5 FS:  System V's native file system, blocks 512 to 2K.
  5164.  
  5165.       sockets:  BSD interface mechanism to networks (compare TLI).
  5166.  
  5167.       STREAMS:  a message-passing kernel mechanism, initially in SVR3, which
  5168.          provides a very good interface for protocol development.
  5169.  
  5170.       TLI (Transport Library Interface):  SV's interface to transport services
  5171.          (TCP, OSI).  UI has also defined an APLI (ACSE/Presentation Library
  5172.          Interface)
  5173.  
  5174.       UFS (?):  BSD's native file system, blocks 4K to 8K, cylinder groups,
  5175.          fragments.
  5176.  
  5177.       XTI (X/Open Transport Interface):  TLI with enhancements
  5178.  
  5179. 6.9)  Acknowledgements.
  5180.  
  5181.       From: "Pierre (P.) Lewis" <lew@bnr.ca>
  5182.       Date: Sun, 11 Oct 1992 15:29:00 +0000
  5183.       Version: 2.0
  5184.  
  5185.       (in addition to references): pat@bnr.ca, guy@auspex.com,
  5186.       pen@lysator.liu.se, mikes@ingres.com, mjd@saul.cis.upenn.edu,
  5187.       root%candle.uucp@ls.com, ee@atbull.bull.co.at,
  5188.       Aaron_Dailey@stortek.com.  Many thanks!
  5189.  
  5190. -----------------------------
  5191.  
  5192. From: "Casper H.S. Dik" <casper@fwi.uva.nl>
  5193. Subject: Re: What's wrong with select() ?
  5194. Date: 20 Nov 92 08:33:58 GMT
  5195. Sender: news@fwi.uva.nl
  5196. Nntp-Posting-Host: adam.fwi.uva.nl
  5197. To:       info-unix@sem.brl.mil
  5198.  
  5199. bad@flatlin.ka.sub.org (Christoph Badura) writes:
  5200.  
  5201. >In <pat.722210144@bcserv> pat@bcserv.wustl.edu (Niemeyer (Pat)) writes:
  5202.  
  5203. >>    got = select (1, &fdset, NULL, NULL, &timeout);
  5204.  
  5205. >From select(2):
  5206.  
  5207. >      nfound = select(nfds,    readfds, writefds, exceptfds, timeout)
  5208. >...
  5209. >      The first nfds descriptors are checked in
  5210. >      each set; i.e. the descriptors from 0 through nfds-1 in the
  5211. >      descriptor sets are examined.
  5212.  
  5213. >This means that if you want to check fd 6 with select(2) the first
  5214. >parameter has to be at least 6.
  5215.  
  5216. 7
  5217.  
  5218. Casper
  5219.  
  5220. -----------------------------
  5221.  
  5222. From: M Firat <mzf@castle.ed.ac.uk>
  5223. Subject: Loking for a code for GIBBS SAMPLER
  5224. Date: 20 Nov 92 12:52:07 GMT
  5225. To:       info-unix@sem.brl.mil
  5226.  
  5227. Hi,
  5228. I am looking for code (including source) which does Gibbs sampling for
  5229. variance components of one-way random effect model. Has anyone got this
  5230. code for such analysis or is anyone aware of any public domain code for
  5231. such analysis ? Preferably the code would be written in C or Fortran 77.
  5232.  
  5233.  
  5234. Any assistance would be greatly appreciated. Thank you in advance.
  5235.  
  5236. Mehmet Firat
  5237. Edinburgh University
  5238. Dept. of maths and Stats.
  5239. JCMB, 4607
  5240. Edinburgh
  5241.  
  5242. Tel (031) 650 8575
  5243. E-mail  mzf@uk.ac.ed.castle
  5244.  
  5245. -----------------------------
  5246.  
  5247. From: 00mrfox@leo.bsuvc.bsu.edu
  5248. Subject: general unix info needed
  5249. Date: 20 Nov 92 12:53:16 GMT
  5250. To:       info-unix@sem.brl.mil
  5251.  
  5252. could someone please give this unix illiterate some general 
  5253. information on unix.  is it as hard to use as i am led to 
  5254. believe?  if so what makes it so hard?  i know that there
  5255. are *many* different unixes out there--what are the most
  5256. commonly used ones?  finally, i have read about svr4.2
  5257. which is supposed to be an easier to use unix, is it out
  5258. yet?  if not what is the expected release date?  
  5259. in need of info :-) !!
  5260.  
  5261. -----------------------------
  5262.  
  5263. From: Ken McLemore <mclemore@rebec.asd.contel.com>
  5264. Subject: make, makefile where s.'s are in another directory, clean solution ?
  5265. Keywords: make
  5266. Date: 20 Nov 92 14:03:13 GMT
  5267. Sender: News <news@europa.asd.contel.com>
  5268. Nntp-Posting-Host: rebec.asd.contel.com
  5269. To:       info-unix@sem.brl.mil
  5270.  
  5271. we like to keep all our "s." files in one source directory and run makes
  5272. in other directory during development, looking for a clean solution for
  5273. these "s." dependencies other than an explicit entry for each ".c" that
  5274. has macro pathing to the source directory.
  5275. suggestions, thanks in advance....ken
  5276.  
  5277. -----------------------------
  5278.  
  5279. From: Phillip Godwin <cmpsg03@nt.com>
  5280. Subject: text search software(follow-up)
  5281. Date: 20 Nov 92 14:26:31 GMT
  5282. Sender: Usenet News <news@brtph560.bnr.ca>
  5283. X-Xxmessage-Id: <A7326050B3057889@137.120.253.131.in-addr.arpa>
  5284. X-Xxdate: Fri, 20 Nov 92 09:28:48 GMT
  5285. X-Useragent: Nuntius v1.1.1d9
  5286. To:       info-unix@sem.brl.mil
  5287.  
  5288.  
  5289. In my last post...
  5290.  
  5291. > I am working on an UNIX-based application (running on HP 400 and 700 
  5292. > series workstations) that will among other things allow a user to 
  5293. > search a large number of text files for a string.  We had planned
  5294. > to parse grep output for the needed search result information, 
  5295. > but grep is just too slow.
  5296. > What we are looking for is a text search program (commercial or 
  5297. > shared) that we can call from within our application.  Does anyone
  5298. > out there have any experience with UNIX searching software?  I
  5299. > would just like to get an idea of what is out there and then follow
  5300. > up on any interesting leads.
  5301.  
  5302. I got a couple responses (thanks Ken and Erik), but they led me to the
  5303. conclusion that I needed to refine my question.
  5304.  
  5305. We've pretty much decided that a non-indexed search will not work
  5306. due to the nature of the application. The files that are being 
  5307. searched will be updated once per week, and we have off-peak 
  5308. machine time that can be used for indexing after the files are
  5309. updated. 
  5310.  
  5311. Does anyone have any experience with packages that allow indexing 
  5312. and searching? I'd also like to hear from anyone who has used dbm or
  5313. ndbm for indexing.
  5314.  
  5315. If you can help, please email cmpsg03@nt.com.
  5316.  
  5317. Thanks...Phil
  5318.  -------------------------------------------------
  5319.    Phillip Godwin    ||   Northern Telecom    
  5320.    cmpsg03@nt.com    ||   Product Verification
  5321.    (919) 481-8887    ||   RTP, NC             
  5322.  -------------------------------------------------
  5323.  
  5324. -----------------------------
  5325.  
  5326. From: Phillip Godwin <cmpsg03@nt.com>
  5327. Subject: text search software(follow-up)
  5328. Date: 20 Nov 92 14:35:13 GMT
  5329. Sender: Usenet News <news@brtph560.bnr.ca>
  5330. X-Xxdate: Fri, 20 Nov 92 09:37:29 GMT
  5331. X-Useragent: Nuntius v1.1.1d9
  5332. To:       info-unix@sem.brl.mil
  5333.  
  5334.  
  5335. In my last post...
  5336.  
  5337. > I am working on an UNIX-based application (running on HP 400 and 700 
  5338. > series workstations) that will among other things allow a user to 
  5339. > search a large number of text files for a string.  We had planned
  5340. > to parse grep output for the needed search result information, 
  5341. > but grep is just too slow.
  5342. > What we are looking for is a text search program (commercial or 
  5343. > shared) that we can call from within our application.  Does anyone
  5344. > out there have any experience with UNIX searching software?  I
  5345. > would just like to get an idea of what is out there and then follow
  5346. > up on any interesting leads.
  5347.  
  5348. I got a couple responses (thanks Ken and Erik), but they led me to the
  5349. conclusion that I needed to refine my question.
  5350.  
  5351. We've pretty much decided that a non-indexed search will not work
  5352. due to the nature of the application. The files that are being 
  5353. searched will be updated once per week, and we have off-peak 
  5354. machine time that can be used for indexing after the files are
  5355. updated. 
  5356.  
  5357. Does anyone have any experience with packages that allow indexing 
  5358. and searching? I'd also like to hear from anyone who has used dbm or
  5359. ndbm for indexing.
  5360.  
  5361. If you can help, please email cmpsg03@nt.com.
  5362.  
  5363. Thanks...Phil
  5364.  -------------------------------------------------
  5365.    Phillip Godwin    ||   Northern Telecom    
  5366.    cmpsg03@nt.com    ||   Product Verification
  5367.    (919) 481-8887    ||   RTP, NC             
  5368.  -------------------------------------------------
  5369.  
  5370. -----------------------------
  5371.  
  5372. From: Daniel D Suthers <suthers+@pitt.edu>
  5373. Subject: Utility for keeping two directories consistent (identical)?
  5374. Keywords: directory consistency
  5375. Date: 20 Nov 92 15:18:37 GMT
  5376. Sender: news+@pitt.edu
  5377. Followup-To: suthers+@pitt.edu
  5378. To:       info-unix@sem.brl.mil
  5379.  
  5380. Do you know of a utility for keeping the contents of two directories
  5381. consistent (identical)?  Or could a shell hacker send me a tcsh
  5382. script?
  5383.  
  5384. I'm looking for the equivalent of the TI-Explorer
  5385. "balance-directories" -- something that checks file dates and copies
  5386. them in *either direction* to make the directories consistent.
  5387.  
  5388. The point of this: I'm on a distributed file system called AFS. It
  5389. goes down a little too often for my tastes. So I keep my work on my
  5390. workstation disk as well. I want a script to run at the end of the day
  5391. so my work is backed up on AFS.  I also want to be able to edit
  5392. remotely on AFS when at home and update the workstation disk when I
  5393. come into my office. The "parcel" utility won't do it because it
  5394. updates only in one direction (AFS->local). I need something that
  5395. doesn't make any assumptions about what machine the directories are
  5396. on.
  5397.  
  5398. Thanks. Please reply directly to me at suthers+@pitt.edu.
  5399.  
  5400.  
  5401. -- 
  5402.  ..........................................................................
  5403.  Dan Suthers            | LRDC, room 505A
  5404.  suthers+@pitt.edu      | 3939 O'Hara Street
  5405.  (412) 624-7036 office  | University of Pittsburgh
  5406.  
  5407. -----------------------------
  5408.  
  5409. From: lpeters <@hq.af.mil (Leslie D Peters):lpeters@postmaster>
  5410. Subject: Re: grep
  5411. Date: 20 Nov 92 15:37:51 GMT
  5412. Sender: news@pt.hq.af.mil
  5413. To:       info-unix@sem.brl.mil
  5414.  
  5415.  
  5416. |> >Actually it's Global Regular Expression Parser.
  5417. |> I thought it meant Gorns Rarely Eat People...
  5418. Grazing Rabbits Excrete Pellets
  5419. -- 
  5420. /============================================================================\
  5421. |                    ___                     |                               |
  5422. |       ___....-----'---`-----....___        | I haven't lost my mind --     |
  5423. | =========================================  |                               |
  5424. |        ___`---..._______...---'___         |  it's backed up on            |
  5425. |       (___)      _|_|_|_      (___)        |   tape somewhere.             |
  5426. |         \\____.-'_.---._`-.____//          |                               |
  5427. |           ~~~~`.__`---'__.'~~~~            | lpeters@marge.hq.af.mil       |
  5428. |                   `~~~'                    |                               |
  5429. \============================================================================/
  5430.  
  5431. -----------------------------
  5432.  
  5433. From: snolan <@hq.af.mil (Scott D Nolan):snolan@postmaster>
  5434. Subject: Re: grep
  5435. Date: 20 Nov 92 15:45:52 GMT
  5436. Sender: news@pt.hq.af.mil
  5437. To:       info-unix@sem.brl.mil
  5438.  
  5439. |> |> >Actually it's Global Regular Expression Parser.
  5440. |> |> I thought it meant Gorns Rarely Eat People...
  5441. |> Grazing Rabbits Excrete Pellets
  5442. Geraldo Rates Exhibitionist Perverts
  5443. -- 
  5444. Consistency is the hobgoblin of small minds.
  5445.  
  5446.             - Ralph Waldo Emerson
  5447.  
  5448. -----------------------------
  5449.  
  5450.  
  5451. End of INFO-UNIX Digest
  5452. ***********************
  5453.