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

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