home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / question / 10807 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  46.7 KB

  1. Path: sparky!uunet!haven.umd.edu!mimsy!afterlife!adm!news
  2. From: postmaster@vd1.hanscom.af.mil (SMTP MAILER)
  3. Newsgroups: comp.unix.questions
  4. Subject: Mail Delivery Problem
  5. Message-ID: <32398@adm.brl.mil>
  6. Date: 7 Sep 92 21:31:09 GMT
  7. Sender: news@adm.brl.mil
  8. Lines: 1360
  9.  
  10.  
  11.  ----Reason for mail failure follows----
  12. Sending mail to recipient(s) woodfordm :
  13.   Couldn't make final delivery.
  14.  
  15.  ----Transcript of message follows----
  16. Received: from gw1.hanscom.af.mil by vd1.hanscom.af.mil with SMTP ; 
  17.           Mon,  7 Sep 92 14:18:12 EST
  18. Date: 6 Sep 92 16:40:00 EST
  19. From: INFO-UNIX@BRL.MIL
  20. Subject: INFO-UNIX Digest  V16#001
  21. To: "woodfordm" <woodfordm@vd1.hanscom.af.mil>
  22.  
  23. Return-Path: <info-unix-request@sem.brl.mil>
  24. Received: from SEM.BRL.MIL by gw1.hanscom.af.mil with SMTP ; 
  25.           Sun,  6 Sep 92 16:39:48 EST
  26. Received: from SEM.BRL.MIL by SEM.BRL.MIL id ab22412; 6 Sep 92 15:34 EDT
  27. Received: from sem.brl.mil by SEM.BRL.MIL id aa22387; 6 Sep 92 15:15 EDT
  28. Date:       Sun, 06 Sep 92 15:15:49 EST
  29. From:       The Moderator (Mike Muuss) <Info-Unix-Request@BRL.MIL>
  30. To:         INFO-UNIX@BRL.MIL
  31. Reply-To:   INFO-UNIX@BRL.MIL
  32. Subject:    INFO-UNIX Digest  V16#001
  33. Message-ID:  <9209061515.aa22387@SEM.BRL.MIL>
  34.  
  35. INFO-UNIX Digest          Sun, 06 Sep 1992              V16#001
  36.  
  37. Today's Topics:
  38.                        Help with emacs,gnus,stty
  39.              Re: question about Env. Variable "TAE and WS"
  40.                   Re: How to prevent a large core-dump
  41.              Re: Shared memory baby question on ultrix 4.2
  42.                   Re: missing /etc/resolv.conf - help
  43.                         MS Windows 3.1 via UNIX
  44.                      MS Windows 3.1 via SCO UNIX ?
  45.       Wanted: UNIX system/network programming book recommendation
  46.                            Re: Dear vi guru,
  47.           How and where to search old postings of a newsgoup??
  48.                            Re: AWK and arrays
  49.                     Re: Shell Scripts vs. C programs
  50.                               time server?
  51.                           Unix Script Debugger
  52.              Re: need script to rename uppercase filenames
  53.                            Re: AWK and arrays
  54.              Re: need script to rename uppercase filenames
  55.                          Re: vi (cut and paste)
  56.     Looking for good online UNIX tutorial...is there such a animal?
  57.                      Re: Awk: Beginner needs help!
  58.                        UNIX-like OS for PC's ???
  59.                  Re: reliable signals under BSD / SVR4
  60.              Re: need script to rename uppercase filenames
  61.                        changing name of core file
  62.                      Password generator / checker?
  63.                   Re: Awk and getting the current date
  64.                           Re: awk with columns
  65.                         Re: Unix Script Debugger
  66.                             signal handling
  67.              Re: need script to rename uppercase filenames
  68.                  Re: reliable signals under BSD / SVR4
  69.                   Re: Awk and getting the current date
  70.                  Re: reliable signals under BSD / SVR4
  71. -----------------------------------------------------------------
  72.  
  73. From: Steve Franklin <franklin@ug.cs.dal.ca>
  74. Subject: Help with emacs,gnus,stty
  75. Date: 3 Sep 92 21:21:22 GMT
  76. Sender: USENET News <usenet@cs.dal.ca>
  77. Nntp-Posting-Host: ug.cs.dal.ca
  78. To:       info-unix@sem.brl.mil
  79.  
  80. Okay, so I have a question or two with emacs. 
  81.    First of all, Emacs often uses the ctrl-s key in it's various
  82. commands. However, there is a problem with this, because it suspends
  83. data flow over my modem to the computer host. (ctrl-q continues this of
  84. course.) I found one solution using a program called "screen" which lets
  85. you send "^a s" to send teh ctrl character "ctrl-s", but this is rather
  86. clumsy. How can I (manipulating sttys perhaps?) accomadate this, so that
  87. ctrl-s's wonderful suspend-flow feature is disabled? I can  disable
  88. ctrl-z with
  89. stty susp def (?) , but I can't figure it out for ctrl-s... Any thoughts
  90. would be welcomed with great enthusiasm.
  91.    Also, with gnus, I can't seem to figure out how to designate a specific
  92.  .newsrc, OR a specific NNTPSERVER. If you could help me with this I would
  93. be most appreciative. Can I have two *elc files? One for NNTPSERVER #1,
  94. and .newsrc #1, and one for NNTPSERVER #2, and .newsrc #2?
  95.    Any thoughts are welcomed.
  96. thanks in advance.
  97.    steve
  98. --
  99. aasdSteveFranklin-Subliminal Psychology Major.ks;dlasBlueJaysRULEkasdfeahsdbfl
  100. sd;lfaswoq[eBuyMeAQuadra!!!mbnZMXCNdfsba;KdSPAMiuroqiyetIBMSuxiweuryth'ewr;mxn
  101. qpuepriuPartyOneqtuj;,n.,xnc,kjasFlameMeNot!;lkj;lkgkjd;askElvisLivesjhfquweru
  102. zx.cfranklin@ug.cs.dal.ca,sk;t;lrut[Superboy@ac.dal.cav.zx,Physics!eq3rwkh;oHA
  103.  
  104. -----------------------------
  105.  
  106. From: John Ruschmeyer <jruschme@nyx.cs.du.edu>
  107. Subject: Re: question about Env. Variable "TAE and WS"
  108. Date: 3 Sep 92 18:14:53 GMT
  109. Sender: netnews admin account <usenet@mnemosyne.cs.du.edu>
  110. X-Disclaimer: Nyx is a public access Unix system run by the University
  111.     of Denver for the Denver community.  The University has neither
  112.     control over nor responsibility for the opinions of users.
  113. To:       info-unix@sem.brl.mil
  114.  
  115. In article <3501@babcock.cerc.wvu.wvnet.edu> hongman@cathedral.cerc.wvu.w
  116. net.edu (Guo Hongman) writes:
  117. >
  118. > Can any tell me what's TAE and WS meaning ? What are they used for ? Ho
  119.  to
  120. >
  121. > use them ?
  122. >
  123. >
  124. > Thanks in advance !!
  125.  
  126.  
  127. The Transportable Application Environment Plus (TAE+) is an X11-based
  128. GUI builder which was developed by NASA and runs on a variety of
  129. platforms.
  130.  
  131. $TAE should be the root of the TAE+ directory tree.
  132.  
  133. <<<John>>>
  134.  
  135. -----------------------------
  136.  
  137. From: Dave Gordon <dsg@impmh.uucp>
  138. Subject: Re: How to prevent a large core-dump
  139. Date: 1 Sep 92 15:08:13 GMT
  140. To:       info-unix@sem.brl.mil
  141.  
  142. In <1992Aug25.173056.13401@utwente.nl> soos@math.utwente.nl (Adwin Soos) writes:
  143.  
  144. >A few weeks or even months ago I have read some discussion about the problem
  145. >of preventing a core-dump. I remember that there were some suggestions on how
  146. >to prevent that a large core-dump will be made. 
  147. >This problem is now occurring at our place where someone is writing a large
  148. >program and in some test-cases there is a core dump for more than 60 Mb.
  149. >This person is not using this core to debug it so maybe we can just stop the
  150. >creation of this core for this person.
  151.  
  152. One simple method that should work on all UN*X systems is to create a file
  153. named "core" in the working directory of the offending program, and give
  154. it no permissions:
  155.     echo > core
  156.     chmod 0 core
  157. Then the program will not produce a core, since the file "core" already
  158. exists, but is unwritable (see signal(2)).
  159. -- 
  160.             Dave
  161.             ====
  162.  
  163. -----------------------------
  164.  
  165. From: Dave Gordon <dsg@impmh.uucp>
  166. Subject: Re: Shared memory baby question on ultrix 4.2
  167. Keywords: shared memory permissions
  168. Date: 1 Sep 92 15:56:24 GMT
  169. To:       info-unix@sem.brl.mil
  170.  
  171. In comp.unix.questions deano@piglet.otago.ac.nz writes:
  172.  
  173. > Help Help Help
  174. >
  175. > I don't understand shared memory.  Sorry, but all I can find in the
  176. > documentation for our DECstations is the man pages which tell me what to use
  177. > and what to pass but not HOW to use ?!?!?!?!?!?
  178. >
  179. > at the moment I do this :
  180. >
  181. > key = ftok("/tmp", 'a');
  182. > shmid = shmget(key, 64, IPC_CREAT | IPC_EXCL);
  183. > s = shmat(shmid, 0, SHM_R | SHM_W);
  184. >
  185. > *s = 1; /* BARF BARF BARF, kernel acces since s == -1 */
  186. >
  187. > help help help
  188.  
  189.  
  190.  
  191. deano's problem is in the parameters to the shmget(2) call ...
  192. the third parameter should include the permissions (modes) for
  193. the new segment; the manual page on our system reads:
  194.  
  195.       The low-order 9 bits of shm_perm.mode are set equal to the
  196.             low-order 9 bits of shmflg.
  197.  
  198. The shared-memory segment is created with no permissions for
  199. anybody, so the shmat(2) call fails (returns -1).
  200.  
  201. The permissions are just like those used for files, except that
  202. there is no 'execute' mode.  So the third parameter could be
  203.         (IPC_CREAT|IPC_EXCL|0666)
  204. which gives read/write permission to everybody, or some other modes,
  205. according to what is wanted.
  206.  
  207. ipcs(1) will display the status of shared memory segments including
  208. permissions.
  209.  
  210.  
  211. PS:
  212. deano: I tried to mail this to deano@piglet.otago.ac.nz, but it
  213. bounced at uknet.ac.uk; are you sure about your mail address??
  214. -- 
  215.             Dave
  216.             ====
  217.  
  218. -----------------------------
  219.  
  220. From: Simon Langley <slangley@constant.demon.co.uk>
  221. Subject: Re: missing /etc/resolv.conf - help
  222. Date: 2 Sep 92 20:59:51 GMT
  223. X-Newsreader: Tin 1.1 PL5
  224. To:       info-unix@sem.brl.mil
  225.  
  226. Sabina Wolfson (swolfson@nyx.cs.du.edu) wrote:
  227. : wait a minute or two for it to default to the /etc/hosts file and then
  228. : specify another namer server -- this is a pain)?  Or is there some way
  229. : I can send a request to another name server (I know which namer server
  230. : my site should be using)?
  231. my resolv.conf just says:
  232. nameserver 158.152.1.65
  233.  
  234. and it uses this host as the nameserver.  However, there are other changes
  235. that may need to be made and these are system dependent.  Which UNIX are
  236. you using.
  237.  
  238. -- 
  239.    Simon Langley                   (preferred)   slangley@constant.demon.co.uk
  240.    Hampstead, London                             slangley@cix.compulink.co.uk
  241.  
  242. -----------------------------
  243.  
  244. From: Robert Mohrmann <rlm@wyvern.twuug.com>
  245. Subject: MS Windows 3.1 via UNIX
  246. Date: 3 Sep 92 14:07:47 GMT
  247. To:       info-unix@sem.brl.mil
  248.  
  249. FIRST OF ALL ARE THESE POSTS GETTING OUT? I'VE NEVER USED NN BEFORE.
  250.  
  251.  
  252.       My company department has a problem. We are currently running an
  253. internal software package that was designed to run under "MS Windows 2.1".
  254. The computers that we are running this on are 386 clones running
  255. SCO Unix v3.2 and the VPIX (DOS emulator).
  256.  
  257.       The problem is, the department in charge of the internal software
  258. package is releasing a new version of it and is not going to support the
  259. old one any more. :-( The new version will only run on "MS Windows 3.1"
  260. which does not work under VPIX. Open Desk Top (ODT) does supply a DOS
  261. shell but the price at this time of ODT is prohibitively high for my
  262. department.
  263.  
  264.       Does anybody have any suggestions on how to get around this
  265. dilemma? One idea we had was to reformat the hard disk and to set up one
  266. partition for DOS and another for UNIX. But, we don't know if it is
  267. possible to switch between the two operating systems. Another idea would
  268. be to find some other company that supplies DOS shell software, like
  269. ODT's version, as a separate software package that can be bought for a
  270. little amount of money.
  271.  
  272. Information:
  273.                     Zenith 386
  274.                     SCO UNIX v3.2
  275.                     VPIX v1.1 (DOS emulation package)
  276.                     8M bytes RAM
  277.                     150M Hard Drive
  278.                     VGA graphics card
  279.                     Shades of grey VGA monitor
  280.  
  281.  
  282.  
  283. **-- rlm@wyvern.twuug.com --***********************************************
  284. |    Robert Lee -SAURIAN- Mohrmann  |    Exodus 4:1-5    Numbers 21:5-9   |
  285. ***************************************************************************
  286. -- 
  287. **-- rlm@wyvern.twuug.com --***********************************************
  288. |    Robert Lee -SAURIAN- Mohrmann  |    Exodus 4:1-5    Numbers 21:5-9   |
  289. ***************************************************************************
  290.  
  291. -----------------------------
  292.  
  293. From: Robert Mohrmann <rlm@wyvern.twuug.com>
  294. Subject: MS Windows 3.1 via SCO UNIX ?
  295. Date: 4 Sep 92 00:21:21 GMT
  296. To:       info-unix@sem.brl.mil
  297.  
  298.  
  299.       My company department has a problem. We are currently running an
  300. internal software package that was designed to run under "MS Windows 2.1".
  301. The computers that we are running this on are 386 clones running
  302. SCO Unix v3.2 and the VPIX (DOS emulator).
  303.  
  304.       The problem is, the department in charge of the internal software
  305. package is releasing a new version of it and is not going to support the
  306. old one any more. :-( The new version will only run on "MS Windows 3.1"
  307. which does not work under VPIX. Open Desk Top (ODT) does supply a DOS
  308. shell but the price at this time of ODT is prohibitively high for my
  309. department.
  310.  
  311.       Does anybody have any suggestions on how to get around this
  312. dilemma? One idea we had was to reformat the hard disk and to set up one
  313. partition for DOS and another for UNIX. But, we don't know if it is
  314. possible to switch between the two operating systems. Another idea would
  315. be to find some other company that supplies DOS shell software, like
  316. ODT's version, as a separate software package that can be bought for a
  317. little amount of money.
  318.  
  319. Information:
  320.                     Zenith 386
  321.                     SCO UNIX v3.2
  322.                     VPIX v1.1 (DOS emulation package)
  323.                     8M bytes RAM
  324.                     150M Hard Drive
  325.                     VGA graphics card
  326.                     Shades of grey VGA monitor
  327. -- 
  328. **-- rlm@wyvern.twuug.com --***********************************************
  329. |    Robert Lee -SAURIAN- Mohrmann  |    Exodus 4:1-5    Numbers 21:5-9   |
  330. ***************************************************************************
  331.  
  332. -----------------------------
  333.  
  334. From: Paul Moore <sp_pm@space.alcbel.be>
  335. Subject: Wanted: UNIX system/network programming book recommendation
  336. Date: 4 Sep 92 12:57:03 GMT
  337. X-Received: by usenet.pa.dec.com; id AA16184; Fri, 4 Sep 92 10:49:48 -0700
  338. X-Received: by inet-gw-1.pa.dec.com; id AA02305; Fri, 4 Sep 92 10:49:46 -0700
  339. X-Received: from ub4b.buug.be by mcsun.EU.net with SMTPid AA28231 (5.65b/CWI-2.174); Fri, 4 Sep 1992 19:49:30 +0200
  340. X-Received: from alcbel.UUCP by ub4b.buug.be (5.65c/ub4b_02)id AA11878; Fri, 4 Sep 1992 19:49:27 +0200
  341. X-Received: from se.alcbel.be by alcbel.be (4.1/SMI-4.1)id AA06300; Fri, 4 Sep 92 14:54:07 +0200
  342. X-Received: by se.alcbel.be (5.57/SE_03)id AA18228; Fri, 4 Sep 92 14:57:41 +0200
  343. X-Received: from btmpjw.space by space.alcbel.be (4.1/SMI-4.0)id AA08149; Fri, 4 Sep 92 14:57:03 +0200
  344. X-To: comp.unix.questions.usenet
  345. To:       info-unix@sem.brl.mil
  346.  
  347.  
  348. Hello,
  349.  
  350.  
  351. I'm looking for books that deal with UNIX network and system programming.
  352.  
  353. A book that has been recommended to me is:
  354.  
  355.     UNIX Network Programming, by W. Richard Stevens
  356.  
  357. Are there any other books available in this field?
  358.  
  359.  
  360. I've heard that Stevens has another book available, just recently published:
  361.  
  362.     Advanced UNIX SYstem Programming
  363.  
  364. or some such similar title. Has anyone seen this book, or offer any comments?
  365.  
  366.  
  367. Please email responses, as I don't have a News connection. As usual, I'll summarise responses if there is sufficient interest.
  368.  
  369.  
  370. Thanks in advance for any replies,
  371.  
  372. - Paul
  373.  
  374.  -------------------------------------------------------------------------------
  375. email: sp_pm@space.alcbel.be       smail: Paul Moore
  376.                                           Alcatel Bell Telephone,
  377. phone: (+32) 3/829.5024                   Space Dept.,
  378.                                           Berkenrodelei 33,
  379.                                           2660 Hoboken,
  380.                                           Belgium.
  381.  
  382. -----------------------------
  383.  
  384. From: Wade Guthrie <wade@nb.rockwell.com>
  385. Subject: Re: Dear vi guru,
  386. Date: 3 Sep 92 22:58:58 GMT
  387. Sender: Wade Guthrie <wade@nb.rockwell.com>
  388. To:       info-unix@sem.brl.mil
  389.  
  390.  
  391. In article <1992Sep3.163059.10935@uhura1.uucp>, bryan@uhura1.uucp (Bryan Curnutt) writes:
  392. > In article <1992Sep2.233330.18751@ncar.ucar.edu> tparker@music.scd.ucar.edu (Tom Parker) writes:
  393. > >In article <1992Sep2.224136.24163@nsisrv.gsfc.nasa.gov> schieb@shark.gsfc.nasa.gov (Brian D. Schieber) writes:
  394. > >>Dear vi guru,
  395. > >> 
  396. > >> I like to use tabs alot in just about every session of vi I
  397. > >>work with, It would be great if I had a macro or whatever that
  398. > >>could replace the tabs with the appropriate number of spaces
  399. > >>in a file WHILE in vi. Do you have such a macro?
  400. > >
  401. > >Check if your system has the 'expand' command.  This command converts
  402. > >tabs to spaces, and vice versa.
  403. > ... but is not what Brian asked for.
  404.  
  405. Well, not true. . .
  406. The 'vi' user can use 'expand' from within 'vi'.  For example, to expand
  407. tabs to 4 spaces throughout the file, one should do the following.
  408.     1G
  409. This will move the pointer to the beginning of the file.  Then,
  410.     !Gexpand -4
  411. Where the '!' says "I wanna do some external command", the 'G' says
  412. "and I wanna do it from the current location (the top, 'cause of the
  413. '1G') to the end ('cause 'G' says go to the end)" and the command
  414. is "expand -4" which does the expansion (check out expand(1)).
  415.  
  416.  
  417. > If your system does have the 'expand' command, then something like
  418. >     :map g :%!expand -4^M
  419.  
  420. ya don't need 'map', but this DOES work. . .
  421.  
  422. Hope this helps.
  423.  
  424. Wade
  425.  
  426. -----------------------------
  427.  
  428. From: Atiqullah Hashmi <hashmi@cse.uta.edu>
  429. Subject: How and where to search old postings of a newsgoup??
  430. Date: 4 Sep 92 00:37:29 GMT
  431. To:       info-unix@sem.brl.mil
  432.  
  433. Hi netters,
  434.  
  435. I want to search some postings on the newsgroup 'misc.jobs.offered'.
  436. (or any other newsgroup for that matter).
  437. Can any kind soul tell me 'how' and 'where' to get the postings of 
  438. last few months.
  439.  
  440. Thanks.
  441.  
  442. hashmi
  443. -- 
  444.  ---------------------------------
  445. Atiqullah Hashmi                     
  446. UTA (Univ. of Texas at Arlington)   
  447. hashmi@cse.uta.edu                 
  448.  
  449. -----------------------------
  450.  
  451. From: Mark Christopher <christo@bcarh803.bnr.ca>
  452. Subject: Re: AWK and arrays
  453. Date: 4 Sep 92 18:45:56 GMT
  454. Sender: usenet <news@bnr.ca>
  455. Nntp-Posting-Host: bcarh803
  456. To:       info-unix@sem.brl.mil
  457.  
  458. In article <1992Sep4.030733.27724@newshost.anu.edu.au>,
  459. aps583@huxley.anu.edu.au (Anthony P Scott) writes:
  460. |>Suppose I want to read a bunch of letters one to a line
  461. |>and output the position in the alphabet that they occupy.
  462. |>
  463. |>ie
  464.  .. replace 'a' with '1', 'b' with '2', etc...
  465.  
  466. |>One way I visualized doing this is to write an array called alph[letter]
  467. |>such as:
  468. |>
  469. |>alph[a] =1
  470. |>alph[b] = 2
  471. |>alph[c] = 3
  472.  
  473. You need to say:  alph["a"] = 1; alph["b"] = 2; alph["c"] = 3; etc...
  474.  
  475. |>and then read the lines of text as another array called charact[NR]
  476.  
  477. Why do you need to save them in an array?  Couldn't you just do:
  478.  
  479.     { print alph[$1] }
  480.  
  481. |>and the use the charact array to subscript the alph array ie
  482.  ...
  483. the code didn't work because you didn't initialize your array "alph"
  484. correctly.
  485.  
  486. What would be wrong with:
  487.     {
  488.         print index("abcdefghijklmnopqrstuvwxyz",substr($1,1,1))
  489.     }
  490.  
  491. This would print 0 if the first letter of the first arg was not a
  492. lowercase letter.
  493.  
  494.  
  495.  
  496. |>I hope this is not a silly question.
  497.  
  498. No such thing as a silly question.  Learn how to find the answers
  499. yourself.  Read the man page, read the book, see the movie.  You
  500. will find the answers faster.
  501.  
  502. -- 
  503. Mark Christopher        Bell-Northern Research          christo@bnr.ca
  504.  
  505. -----------------------------
  506.  
  507. From: Stephen Harris <sweh@spuddy.uucp>
  508. Subject: Re: Shell Scripts vs. C programs
  509. Keywords: shell script, C
  510. Date: 3 Sep 92 21:33:36 GMT
  511. To:       info-unix@sem.brl.mil
  512.  
  513. In article <123@steiny.com> steiny@steiny.com (Don Steiny) writes:
  514. >    This may be a matter of scale, but 1000 lines is not a very large 
  515. >program.     Besides, there are still many systems that do not have ksh,
  516. >unfortunately, I have to use them all the time.   Even on Sun's, ksh is
  517. >a "local" program and is not always there.
  518.  
  519. You're right - 1000 lines of C code is not a lot.  1000 lines of shell script
  520. in one program is quite a bit.  (This was just the main message router program.
  521. The whole system comes close to 7000 lines).
  522. On one of the machines, once I had ksh compiled OK, it was easier to write
  523. ksh scripts than c programs (Altos 3068).  Heck!  On this machine the C
  524. compiler would barf on its own include files!
  525. #include <machine.h>
  526.  
  527. That one line program through up tonnes of cpp errors.  Blugh.
  528.  
  529. >a different kettle of fish than 20,000+ line program that run on dozens of
  530. >systems.     Ask Larry Wall, the author of perl and rn.   He wrote perl 
  531. >partially because of the portablity problems with the shell.
  532.  
  533. I would NEVER write 20,000+ line program in script.
  534. In fact, I would try hard and not write a 20,000 line program!
  535. 20 1,000 lines programs sound better :-)  And these 1,000 lines programs
  536. I *might* write in ksh.....
  537. -- 
  538.                                Stephen Harris
  539.                sweh@spuddy.uucp    ...!uknet!axion!spuddy!sweh
  540.  
  541.  * Meeeeow ! Call Spud the Cat on > +44 203 638780 < for free Usenet access *
  542.  
  543. -----------------------------
  544.  
  545. From: "Frederick W. Au" <fau@phantom.uucp>
  546. Subject: time server?
  547. Date: 4 Sep 92 18:12:32 GMT
  548. Sender: daemon@ucbvax.berkeley.edu
  549. To:       info-unix@sem.brl.mil
  550.  
  551.  
  552. I am looking for a time-server like thing to synchronize (more or
  553. less) the clocks on machines spred over a number of subnets.  do you
  554. know of any host (like *.mil, or uunet) or any hardware (like having a
  555. dedicated clock connected to one of the servers) that would do
  556. something like that.  Any hints would be appreciated.  Please respond
  557. by email and i will summarize later...
  558.  
  559.  
  560.                 Fred Au
  561.                 ...!uunet!csfb1!phantom!fau
  562.  
  563. -----------------------------
  564.  
  565. From: Kevin Simonson <simonson@cs.washington.edu>
  566. Subject: Unix Script Debugger
  567. Keywords: unix script debug
  568. Date: 4 Sep 92 20:16:04 GMT
  569. Sender: USENET News System <news@beaver.cs.washington.edu>
  570. To:       info-unix@sem.brl.mil
  571.  
  572.  
  573.      I've been writing Unix scripts for a little bit now.  Whenever I have
  574. trouble with one I always end up inserting a bunch of "echo" statements
  575. into it to try to figure out what's wrong with it, and this has always
  576. solved the problem for me eventually.
  577.  
  578.      My question is whether I'm wasting time with this farely brute force
  579. method.  Does anyone know of a Unix script debugger to solve the problem
  580. without editing the script?  Or even an automated editor that inserts
  581. "echo" statements?  Any information on this would be helpful.
  582.  
  583.                                      ---Kevin Simonson
  584.  
  585. -----------------------------
  586.  
  587. From: x91clifton1@gw.wmich.edu
  588. Subject: Re: need script to rename uppercase filenames
  589. Date: 4 Sep 92 21:23:44 GMT
  590. To:       info-unix@sem.brl.mil
  591.  
  592. In article <1992Sep4.162044.2242@netlabs.com>, lwall@netlabs.com (Larry Wall) writes:
  593. > In article <1992Sep03.151245.11128@Celestial.COM> bill@Celestial.COM (Bill Campbell) writes:
  594. > :         s/\s+$//;   # strip all trailing whitespace including ^M
  595. > Unfortunately, that also deletes the ^J.  Since the script unlinks the
  596. > DOS file, you've just thrown away information that's not easily
  597. > reconstructable.  (In fact, the files won't even be editable unless you
  598. > use GNU emacs.)  It would be safer to move the DOS file to a temporary
  599. > subdirectory until you're sure the translation works right.
  600. > I don't want to discourage anyone from helping people, but help is not
  601. > what booby traps are generally construed as...  :-)
  602. > Larry Wall
  603. > lwall@netlabs.com
  604.  
  605. Since this post is from Larry Wall how about:
  606.  
  607. #!/usr/local/bin/perl
  608. # lwr--change uppercase filenames to lowercase.
  609.  
  610. foreach $upr (@ARGV)    {
  611.         ($lwr = $upr) =~ y/A-Z/a-z/;
  612.         rename($upr, $lwr) || die "lwr: $upr->$lwr: $!\n";
  613. }
  614.  
  615. ;-)
  616.  
  617. /Doug
  618. --
  619. Douglas Clifton [99clifto@lab.cc.wmich.edu]
  620.  
  621. -----------------------------
  622.  
  623. From: John Navarra <navarra@casbah.acns.nwu.edu>
  624. Subject: Re: AWK and arrays
  625. Date: 5 Sep 92 03:07:16 GMT
  626. Sender: "Usenet on news.acns" <usenet@news.acns.nwu.edu>
  627. To:       info-unix@sem.brl.mil
  628.  
  629. In article <1992Sep4.184556.6202@bnr.ca> christo@bnr.ca writes:
  630. >No such thing as a silly question.  Learn how to find the answers
  631. >yourself.  Read the man page, read the book, see the movie. 
  632.                                               ^^^^^^^^^^^^^^ 
  633.  
  634. There's an *AWK* Movie?? Wow, I totally missed it! ;-)
  635.  
  636. bogus! I will have to check my local video store for a tape.
  637.  
  638. -tms
  639.  
  640. -- 
  641. You can get further with a kind word | You can get further with a kind word
  642. and a gun than a kind word alone.    | and a phaser than a kind word and a gun.
  643.           --al capone                |           -- John Navarra
  644. =======From the Lab of the MaD ScIenTIst....navarra@casbah.acns.nwu.edu========
  645.  
  646. -----------------------------
  647.  
  648. From: Don Costello <fazc016@hq.dla.mil>
  649. Subject: Re: need script to rename uppercase filenames
  650. Date: 3 Sep 92 17:10:19 GMT
  651. X-Newsreader: Tin 1.1 PL4
  652. To:       info-unix@sem.brl.mil
  653.  
  654. slix@svcs1.UUCP (Bill Miller) writes:
  655. : Hi, everyone.
  656. : I'm fairly new to unix, and I need a script or procedure to do the following:
  657. :  
  658. : I have some source code in DOS (many separate files) that I tarred under
  659. : DOS and untarred under 386BSD.  The big problem is that all the files
  660. : came through in UPPERCASE and I need a script to mv (rename) them all
  661. : to lowercase quickly.
  662. :  
  663. : Since they're in DOS text format, I realize I also need to strip the 
  664. : extra carriage returns on each line.  I've been successful in doing this
  665. : with:
  666. :  
  667. :   cat (file) | tr -d '\015' > (newfile)
  668. :  
  669. : It would be nice to combine both of these so that I could rename the
  670. : files to uppercase and strip the extra newlines all in one fell swoop
  671. : instead of doing it one file at a time.
  672.  
  673.   I'm assumming you want to rename the files FROM upper TO lower
  674.   case...
  675.  
  676.   Use "tr" like you did above to change the filename.  The following works
  677.   on BSD4.3:
  678.  
  679.      #!/bin/sh
  680.      #
  681.      for oldfname in *
  682.      do
  683.         cat $oldfname | tr -d '\015' > `echo $oldfname | tr [A-Z] [a-z]`
  684.      done
  685.  
  686.   You still have to remove the "$oldfname" before you end.  I really
  687.   don't think there is a way to do it all at once because you are
  688.   reading the *contents* of the file and sending the lines, less the
  689.   "^M", to a newfile (lowercase of the original).
  690.  
  691.   My suggestion for the future... PKZip the files on your PC, then UnZip
  692.   (using Info-Zip "unzip") and the files will be lower case and the CR/LF 
  693.   translated correctly.
  694.  
  695.   But then again, your question breeds shell practice... :-)).
  696.  
  697.   Cheers  -- dcc --
  698. -- 
  699. +------------------------------------+---------------------------+
  700. | Don Costello, DASC-ZSC             |  It's hard to cram this   |
  701. | DLA Cameron Station, VA            |  signature into just 4    |
  702. | TEL: (703) 274-7215  AV: 284-7215  |  lines!!!                 | 
  703.  
  704. -----------------------------
  705.  
  706. From: Alex Martelli <martelli@cadlab.sublink.org>
  707. Subject: Re: vi (cut and paste)
  708. Keywords: vi
  709. Date: 2 Sep 92 13:40:55 GMT
  710. To:       info-unix@sem.brl.mil
  711.  
  712. sgr@alden.UUCP (Stan Ryckman) writes:
  713.  
  714. :In article <1992Aug17.200149.7817@s912%bnf.com> bibb@s912%bnf.com (Ken Bibb) writes:
  715. :>In <3815@keele.keele.ac.uk> phd85@seq1.keele.ac.uk (D.H. Holden) writes:
  716. :>> hi, 
  717. :>>    Does anyone know how you cut a range of text to one
  718. :>>    of the named buffers, where the range does not cover
  719. :>>   an integer number of lines, i.e., 
  720. :>>  How do i cut from here > text  text text ..........
  721. :>>  ............... n number of lines .....
  722. :>> ...... to here <  into the named buffer "a for example?
  723. :>>    Cheers,
  724. :>>              Dave.
  725. :>In the following texT:
  726. :>aaabbbbbb
  727. :>bbbbbbbbb
  728. :>bbbbccccc
  729. :>
  730. :>I'll assume you want to cut the b's out and save them into buffer a.
  731. :>1) position the cursor at the beginning of the range to be cut (1Gfb will work
  732. :>   in this example).
  733. :>2) ma (mark the location with marker a)
  734. :>3) move to the end of the range (Gfc will work in this example)
  735. :>4) "ad`a will cut the range and put it into buffer a
  736. :
  737. :NOT!
  738. :
  739. :This grabs all three full lines.  (I tried it!  Did you?)
  740.  
  741. You are wrong.  Yes, I did try Ken's suggestion, and it works perfectly!
  742. Your mistake is probably that sub 4), where Ken specifies a ` (reverse
  743. quote) you used a ' (quote); THAT would grab the three full lines!
  744.  
  745. :Dave presumably wants to have the remaining text be:
  746. :aaaccccc
  747. :
  748. :and the buffer to contain:
  749. :bbbbbb
  750. :bbbbbbbbb
  751. :bbbb
  752.  
  753. Which is EXACTLY what Ken's sequence does.
  754.  
  755. :"Mark" (the "m" command) only marks the line, NOT the cursor
  756. :position within the line.
  757.  
  758. You are wrong.  m DOES mark the column position within the line; then,
  759. if you use a ' (quote) to get back to the mark, you'll use the full
  760. marked line, but if you use a ` (backquote) you'll get the exact
  761. portion of the line.
  762.  
  763. :Am cross-posting to comp.editors, since someone there may know
  764. :for sure whether there _is_ a way to do this, and if I'm wrong I'd
  765. :like to know.  But please, _TRY_ it before posting!
  766.  
  767. The cross-posting was a good idea, since I'm reading this in
  768. comp.editors.  And yes, I do know for sure, and YES, I *DID*
  769. try the exact sequence of commands which you claim fail, and
  770. they work like a charm.
  771. -- 
  772. Email: martelli@cadlab.sublink.org                   Phone: ++39 (51) 6130360
  773. CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia   Fax: ++39 (51) 6130294 
  774.  
  775. -----------------------------
  776.  
  777. From: William Daul <billd@informix.com>
  778. Subject: Looking for good online UNIX tutorial...is there such a animal?
  779. Date: 4 Sep 92 18:10:08 GMT
  780. Sender: Usenet News <news@informix.com>
  781. Originator: billd@cheetah
  782. To:       info-unix@sem.brl.mil
  783.  
  784. Please let me know where to look.
  785.  
  786. Thanks,  --Bill
  787. -- 
  788. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  789.  William Daul             Advanced Support      INFORMIX SOFTWARE INC.
  790.  4100 Bohannon Dr.        (415) 926-6488 - wk
  791.  Menlo Park, CA. 94025    uunet!infmx!billd  or  billd@informix.com
  792.  
  793. -----------------------------
  794.  
  795. From: Samuel Kamens <snk@fork.bae.bellcore.com>
  796. Subject: Re: Awk: Beginner needs help!
  797. Keywords: awk unix
  798. Date: 4 Sep 92 20:22:38 GMT
  799. Sender: news@walter.bellcore.com
  800. Nntp-Posting-Host: fork.bae.bellcore.com
  801. To:       info-unix@sem.brl.mil
  802.  
  803. In article <5608@ucsbcsl.ucsb.edu>, 6500scv1@ucsbuxa.ucsb.edu (Steven C. Velasco) writes:
  804. > HI,
  805. > I am new to unix, and really new to awk, so hopefully somebody can
  806. > answer this question real easily.  I have hundreds of SAS program
  807. > files written for MVS, that we now need to run on UNIX.  
  808. > The files from MVS look like this :
  809. > COMMAND? list unnumbered
  810. > //MVS JCL statements
  811. > //MVS JCL statements
  812. > //MVS JCL statements
  813. > DATA _NULL_ ;
  814. >    SET SASLIB.DATASET ;
  815. > MORE SAS STATEMENTS
  816. > RUN ;
  817. > I can get awk to print out the lines that don't contain the string  "//"
  818. > or "COMMAND?" in $1, but I would like to have
  819. > something that replaces the entire line  "COMMAND? list unnumbered"
  820. > (this is always the first line, and occurs just once) 
  821. > with the string: "libname saslib /usr2/username/datasets"  or, to 
  822. > somehow put the "libname" string in the first line of each file.
  823. > So the resulting file would look like this:
  824. > libname saslib '/usr2/username/datasets' ;
  825. > DATA _NULL_ ;
  826. >    SET SASLIB.DATASET ;
  827. > MORE SAS STATEMENTS ;
  828. > RUN ;
  829. > below is my feeble attempt to do this.  When I run this program, I
  830. > get a message saying something like 'awk: cant set $0 at record 1':
  831. > $1 !~ /\/\// { if ( $0 ~ /COMMAND? list unnumbered/ ) 
  832. > $0 = "libname saslib /usr2/username/datasets ;" 
  833. > print >FILENAME }  
  834. > What am I doing wrong?  I would appreciate any help or suggestions.
  835.  
  836. I think what you're doing wrong is using the wrong tool!
  837.  
  838. Try it with sed, as follows:
  839.  
  840. sed \
  841. -e "s:COMMAND? list unnumbered:libname saslib'/usr2/username/datasets';:" \
  842. -e /^COMMAND/d \
  843. -e /^\/\//d \
  844. filename > outfile.
  845.  
  846.  
  847. You could also do it in awk, as follows:
  848.  
  849. awk '/^COMMAND?/     { print "libname saslib '/usr2/username/datasets' ;"
  850.               next
  851.               }
  852.      /^\/\//            { next }
  853.             { print }
  854. ' infile
  855.  
  856.  
  857.  
  858. See which one you like better!!
  859.  
  860. Sam Kamens                    Bell Communications Research
  861. snk@bae.bellcore.com                Phone: (908) 699-7509
  862. 444 Hoes Lane  Room RRC 1D-210
  863. Piscataway, NJ 08854
  864.  
  865. -----------------------------
  866.  
  867. From: Mike Kelley <kelley@kelley.nist.gov>
  868. Subject: UNIX-like OS for PC's ???
  869. Date: 4 Sep 92 21:22:47 GMT
  870. Sender: news@dove.nist.gov
  871. To:       info-unix@sem.brl.mil
  872.  
  873. I am looking to put a UNIX-like operating system on a PC-compatible
  874. computer.  As this is for personal use, expense is a major
  875. consideration.  Could someone please tell me where to find information
  876. concerning the advantages or disadvantages of the various UNIX and
  877. UNIX-like (e.g. COHERENT, QNX, ... ) systems currently available?
  878.  
  879. My system is currently a 286 class machine. However, as I am looking to
  880. upgrade to a 386 or 486 in the near future anyway, information on the
  881. software available on any of these would be useful.
  882.  
  883. Thanks in advance for whatever help you might be able to provide.
  884.  
  885.  
  886. -- 
  887. Mike Kelley
  888. Bldg 220, Rm B206
  889. National Institute of Standards and Technology
  890. Gaithersburg, MD 20899
  891. (301) 975-3722  FAX (301) 926-2746
  892. INTERNET:    kelley@epg.nist.gov
  893. BITNET:        mkelley@nbsenh.BITNET
  894.  
  895. -----------------------------
  896.  
  897. From: Terry Lambert <terry@thisbe.npd.novell.com>
  898. Subject: Re: reliable signals under BSD / SVR4
  899. Keywords: signals, reliable, software interrupts
  900. Date: 4 Sep 92 21:32:03 GMT
  901. Sender: Terry Lambert <terry@thisbe>
  902. Nntp-Posting-Host: thisbe.eng.sandy.novell.com
  903. To:       info-unix@sem.brl.mil
  904.  
  905. In article <acourtny.715602566@unix1.tcd.ie>, acourtny@unix1.tcd.ie (Antony A. Courtney) writes:
  906. |> In <1992Sep4.004436.24755@gateway.novell.com> terry@thisbe.Eng.Sandy.Novell.COM (Terry Lambert) writes:
  907. |> 
  908. |> >In article <acourtny.715556934@unix1.tcd.ie> acourtny@unix1.tcd.ie (Antony A. Courtney) writes:
  909. |> >>There are some "hacks" to get around this, if you're environment lets you
  910. |> >>write the centralized control loop for the program.  But usually SIGIO is
  911. |> >>useful in cases where that isn't possible, e.g. when using an X toolkit.
  912. |> >
  913. |> >    Wrong.  In XTMainAppLoop() in the X toolkit, there are hooks for
  914. |> >adding input sources to be "select()"ed on.
  915. |> > [...]
  916. |> 
  917. |>     I didn't assert that it was totally impossible, just that it was a
  918. |> "hack".  Adding extra input sources before passing control to XTMainAppLoop()
  919. |> is a bit like saying "take over the control flow and tell me when something
  920. |> happens that you understand (X events).  Oh, and also please tell me about
  921. |> anything else that happens on these descriptors, even though you have no idea
  922. |> what they are for and you don't know how to deal with them."  I humbly suggest
  923. |> that this is hardly what one would call "elegant".
  924.  
  925.     Well, a hack's basically what you are doing.  The other method, which
  926. *truly* is a hack, is to select on your descriptors AND the Xfd, and call an
  927. unrolled XtMainAppLoop() for the processing of X events only.  Certainly the
  928. registration of imput sources is more elegant than that.  And there's no
  929. requirement that the input sources can not be registered as part of a callback
  930. routine *after* entering XtMainAppLoop(), unless you are talking about command
  931. line parameters on which the main thread of execution is supposed to act.
  932.  
  933.     The problem is that your application is using a toolkit at all, given the
  934. non-event-driven nature of it, since a toolkit assumes that you will be doing
  935. event callback processing.  This is fine for word processors and calculators
  936. and such, but sucks out for anything with multiple input sources (like telnet or
  937. xterm or talk).  There is a problem when you try to mix thread of execution
  938. paradigms, like clasical procedural and event based programming styles.
  939.  
  940.     Perhaps what you really need is to start with XtMainAppLoop() as your
  941. main procedural function, or simply use the object drawing code directly, if
  942. what you are doing is antithetical to "toolkit" programming.
  943.  
  944. |> >    Read the fine manual.
  945. |> 
  946. |>     I have read the fine manual on select() for my Unix system.  Too bad X
  947. |> toolkits hide "all that underlying system control flow stuff" from me...
  948.  
  949.     Perhaps I was to flip here, in not siting the O'Reilly X Toolkit
  950. programmer's guide (Hi Tim!  I want a commision!), seeing as you appear to
  951. have gotten the impression I was referring to the UNIX manual page on select().
  952. I was referring to where you would find documentation on the input registration
  953. mechanisms I cited, not denigrating your desire to use select().
  954.  
  955.     Another alternative would be to download the X Toolkit from one of the
  956. many ftp sites (export.lcs.mit.edu, gatekeeper.dec.com, wuarchive.wustl.edu,
  957. etc.) and reimplement the main loop callback mechanism procedurally.  I did
  958. this for "TERM for X Windows" with only a little difficulty about 2 or 2 1/2
  959. years ago.
  960.  
  961.     I don't think anyone who has tried to do a complex job using an X
  962. interface toolkit would argue that they are suitable for complex jobs; however,
  963. I normally look at problems in light of "how can I *make* this work".  This is
  964. pretty much how you can *make* it work.  Good luck on your problem.
  965.  
  966.  
  967.                     Terry Lambert
  968.                     terry_lambert@gateway.novell.com
  969.                     terry@icarus.weber.edu
  970.  
  971. ---
  972. Disclaimer:  Any opinions in this posting are my own and not those of
  973. my present or previous employers.
  974.  
  975. -----------------------------
  976.  
  977. From: Bill Miller <slix@svcs1.uucp>
  978. Subject: Re: need script to rename uppercase filenames
  979. Date: 4 Sep 92 22:02:14 GMT
  980. To:       info-unix@sem.brl.mil
  981.  
  982. In article <1992Sep3.083107.11920@athena.mit.edu>, benjy@athena.mit.edu (Benjamin B Thomas) writes:
  983. B
  984. > Try:
  985. > #!/bin/csh 
  986. > foreach i ($argv)
  987. > setenv file $i
  988. > cat $file | tr -d '\015' > `echo foo | nawk '{print tolower(ENVIRON["file"])}'`
  989. o> rm $file
  990. I tried that, but it doesn't work.  It simply zero-lengths the first
  991. file it finds and then promptly goes to bed - in a loop and doesn't
  992. process further.  Killing it locks up the system.  I don't understand
  993. one or two things.  i dont seem to have 'nawk', I guess I could try
  994. substituting 'awk'?  Also, what is 'foo'?  Does csh understand 'foo' to
  995. mean something special, or is it trying to echo a file called 'foo' which
  996. I don't have?
  997.  
  998. -----------------------------
  999.  
  1000. From: Dan Stanger <dxs@evolving.com>
  1001. Subject: changing name of core file
  1002. Date: 3 Sep 92 21:06:50 GMT
  1003. To:       info-unix@sem.brl.mil
  1004.  
  1005. does anyone know how to change the name of the core file that will be
  1006. created if a program fails.  we have several programs running in the
  1007. same directory so if more than one of them fails the core file from
  1008. one overwrites the other.  we would like to change the name to
  1009. program.core or somthing like that.
  1010.  
  1011. thanks
  1012.  
  1013. dxs@evolving.com
  1014.  
  1015. -----------------------------
  1016.  
  1017. From: Ian Macky <ian@centric.com>
  1018. Subject: Password generator / checker?
  1019. Date: 3 Sep 92 23:01:49 GMT
  1020. Sender: usenet@centric.com
  1021. Originator: ian@raven
  1022. To:       info-unix@sem.brl.mil
  1023.  
  1024. I recently rank the 'crack' program on our firewall machine and had some nasty
  1025. surprises!  Yikes!
  1026.  
  1027. So, does anyone have a password generator program?  The kind that makes 'typable',
  1028. pronounceable passwords, but ones that are meaningless?  I'd like to make it
  1029. available to my users for those who can't make up random gubbish on their own.
  1030.  
  1031. Also, what about a version of the passwd program that applies crack-style rules to
  1032. the user's choice and refuses to let them enter obviously crackable passwords in
  1033. the first place?
  1034.  
  1035. --ian
  1036.  
  1037. -----------------------------
  1038.  
  1039. From: Mark Christopher <christo@bcarh803.bnr.ca>
  1040. Subject: Re: Awk and getting the current date
  1041. Date: 3 Sep 92 22:20:04 GMT
  1042. Sender: usenet <news@bnr.ca>
  1043. Nntp-Posting-Host: bcarh803
  1044. To:       info-unix@sem.brl.mil
  1045.  
  1046. In article <1992Sep3.135708.28491@rtf.bt.co.uk>, duplain@rtf.bt.co.uk
  1047. (Andy Duplain) writes:
  1048. |>In article <1992Sep1.214207.1@sc9> mbrodesky@sc9 writes:
  1049. |>>How can I get the current date in a AWK program
  1050.  ...
  1051. |>        #!/bin/sh
  1052. |>        awk -e 'BEGIN { 
  1053. |>            date="'`date`'"
  1054. |>        }
  1055.  ...
  1056.  
  1057. Or in nawk:
  1058.  
  1059.     nawk 'BEGIN { "date" | getline; date=$0}
  1060.         {
  1061.           print date,$0
  1062.         }'
  1063.  
  1064. Not tough.  Learn to read the manual.
  1065. -- 
  1066. Mark Christopher        Bell-Northern Research          christo@bnr.ca
  1067.  
  1068. -----------------------------
  1069.  
  1070. From: Mark Christopher <christo@bcarh803.bnr.ca>
  1071. Subject: Re: awk with columns
  1072. Date: 3 Sep 92 22:24:16 GMT
  1073. Sender: usenet <news@bnr.ca>
  1074. Nntp-Posting-Host: bcarh803
  1075. To:       info-unix@sem.brl.mil
  1076.  
  1077. In article <29098@hydra.Helsinki.FI>, karell@cs.Helsinki.FI (Esa Karell)
  1078. writes:
  1079. |>Could someone tell me what would be the easisest
  1080. |>way to accomplish this with awk.
  1081.  
  1082. |>X    Y  T        P I
  1083. |>1    2  3        4 5
  1084.  
  1085. |>I'd need to swap the values of Y & T so output should look:
  1086. |>
  1087. |>X    Y  T        P I
  1088. |>1    3  2        4 5
  1089. |>.    .  .        . .
  1090. |>
  1091. |>All the blanks between the columns should remain the same.
  1092.  
  1093. Well, what do you think?  Two easy ways:
  1094.  
  1095. Come up with a printf format string and say
  1096.  
  1097.     { printf "....format....",$1,$3,$2,$4,$5 }
  1098.  
  1099. or else find the column numbers and do:
  1100.  
  1101.     { print substr(..),substr(..),... }
  1102.  
  1103. -- 
  1104. Mark Christopher        Bell-Northern Research          christo@bnr.ca
  1105.  
  1106. -----------------------------
  1107.  
  1108. From: "S.Ramakrishnan" <ramakris@csgrad.cs.vt.edu>
  1109. Subject: Re: Unix Script Debugger
  1110. Keywords: unix script debug
  1111. Date: 4 Sep 92 23:44:57 GMT
  1112. Sender: usenet@creatures.cs.vt.edu
  1113. To:       info-unix@sem.brl.mil
  1114.  
  1115. In article <1992Sep4.201604.717@beaver.cs.washington.edu> simonson@cs.washington.edu (Kevin Simonson) writes:
  1116. >
  1117. >     I've been writing Unix scripts for a little bit now.  Whenever I have
  1118. >trouble with one I always end up inserting a bunch of "echo" statements
  1119. >into it to try to figure out what's wrong with it, and this has always
  1120. >solved the problem for me eventually.
  1121. >
  1122. >     My question is whether I'm wasting time with this farely brute force
  1123. >method.  Does anyone know of a Unix script debugger to solve the problem
  1124. >without editing the script?  Or even an automated editor that inserts
  1125. >"echo" statements?  Any information on this would be helpful.
  1126. >
  1127. >                                     ---Kevin Simonson
  1128.  
  1129. If you are using perl there is a debugger available.
  1130.  
  1131. If you are using csh/sh, you can run it in the "debugging" mode
  1132. as
  1133.  
  1134.   #sh -x <script> or % csh -x <script>
  1135.  
  1136. which displays the statements as they are executed and the values of
  1137. the intermediate expressions and variables as a statement is  executed.
  1138. Of course, this still doesn't beat having a debugger shc as that for perl.
  1139.  
  1140. ---
  1141. S Ramakrishnan, CS Dept, McBryde Hall, VaTech
  1142.  
  1143. -----------------------------
  1144.  
  1145. From: Dan Stanger <dxs@evolving.com>
  1146. Subject: signal handling
  1147. Date: 3 Sep 92 23:14:14 GMT
  1148. To:       info-unix@sem.brl.mil
  1149.  
  1150. i want to write a program with the following structure
  1151.  
  1152. linked_list
  1153.  
  1154. handler()
  1155. {
  1156.    put structure on linked list indicating signal
  1157. }
  1158.  
  1159. main()
  1160. {
  1161.    loop
  1162.       disable signals
  1163.       check linked list to see if a signal occured
  1164.       enable signals
  1165.       /* location 1 */
  1166.       wait on message queue until message is sent
  1167.       disable signals
  1168.       check linked list to see if a signal occured
  1169.       enable signals
  1170.       process either message or signal
  1171.    end loop
  1172. }
  1173.  
  1174. since the wait on the message queue will be terminated if a signal
  1175. occurs the signal will be handled quickly.  however if the signal
  1176. occurs while the program is at location 1 then the signal will not
  1177. be handled until a message comes in.
  1178.  
  1179. is there a way around this?
  1180. thanks
  1181. dan stanger
  1182.  
  1183. -----------------------------
  1184.  
  1185. From: Bill Miller <slix@svcs1.uucp>
  1186. Subject: Re: need script to rename uppercase filenames
  1187. Date: 4 Sep 92 23:24:19 GMT
  1188. To:       info-unix@sem.brl.mil
  1189.  
  1190. In article <1992Sep3.120607.25089@umbc3.umbc.edu>, rouben@math13.math.umbc.edu (Rouben Rostamian) writes:
  1191.  
  1192. > I would suggest the quicker script:
  1193. > #!/bin/sh
  1194. > for file in *[A-Z]*
  1195. > do
  1196. > mv $file `echo $file | tr '[A-Z]' '[a-z]'`
  1197. > done
  1198. > This script changes all files names containing an uppercase letter 
  1199. > in the current directory to lowercase.  I would not strip the \015s
  1200. > so casually without knowing the contents of the files.
  1201.  
  1202. First of all, when I try that, it just stops, and starts echoing every
  1203. thing I type  since I first run it to a 'typescript' file which eventually
  1204. grows fairly large.  I can't kill the pid for the script - if I do that
  1205. the system hangs.
  1206.  
  1207. FWIW I use 386BSD and csh, but nothing so far has worked as intended.
  1208.  
  1209. -----------------------------
  1210.  
  1211. From: Terry Lambert <terry@thisbe.eng.sandy.novell.com>
  1212. Subject: Re: reliable signals under BSD / SVR4
  1213. Keywords: signals, reliable, software interrupts
  1214. Date: 4 Sep 92 00:44:36 GMT
  1215. Sender: NetNews <news@gateway.novell.com>
  1216. Nntp-Posting-Host: thisbe.eng.sandy.novell.com
  1217. To:       info-unix@sem.brl.mil
  1218.  
  1219. In article <acourtny.715556934@unix1.tcd.ie> acourtny@unix1.tcd.ie (Antony A. Courtney) writes:
  1220. >There are some "hacks" to get around this, if you're environment lets you
  1221. >write the centralized control loop for the program.  But usually SIGIO is
  1222. >useful in cases where that isn't possible, e.g. when using an X toolkit.
  1223.  
  1224.     Wrong.  In XTMainAppLoop() in the X toolkit, there are hooks for
  1225. adding input sources to be "select()"ed on.  Since this is the toolkit used
  1226. to build most other toolkits (ie: Motif), this works there also.  The
  1227. routines of interest are:
  1228.  
  1229.     XtAddInput()
  1230.     XtAppAddInput()
  1231.     XtRemoveInput()
  1232.     XtRemoveAllInputs()
  1233.  
  1234.     Read the fine manual.
  1235.  
  1236.  
  1237.                     Terry Lambert
  1238.                     terry_lambert@gateway.novell.com
  1239.                     terry@icarus.weber.edu
  1240.  
  1241. ---
  1242. Disclaimer:  Any opinions in this posting are my own and not those of
  1243. my present or previous employers.
  1244.  
  1245. -----------------------------
  1246.  
  1247. From: Andy Duplain <duplain@rtf.bt.co.uk>
  1248. Subject: Re: Awk and getting the current date
  1249. Date: 3 Sep 92 13:57:08 GMT
  1250. To:       info-unix@sem.brl.mil
  1251.  
  1252. In article <1992Sep1.214207.1@sc9> mbrodesky@sc9 writes:
  1253. >How can I get the current date in a AWK program
  1254.  
  1255.     I assume you mean "awk" not "nawk" or "gawk"; nawk and gawk
  1256.     allow commands to forked and the output from those commands
  1257.     to be read (RTFM for details).  In awk you will have to wrap
  1258.     the awk script in a shell script and assign the date to an
  1259.     awk variable:
  1260.     
  1261.         #!/bin/sh
  1262.         awk -e 'BEGIN { 
  1263.             date="'`date`'"
  1264.         }
  1265.         {
  1266.             print date
  1267.         }'
  1268.         
  1269.         (or something like that)
  1270.     
  1271. -- 
  1272. Andy Duplain, BT Customer Systems, Brighton, UK.            duplain@rtf.bt.co.uk
  1273. #define    DISCLAIMER      My views and opinions are my own, and not my company's
  1274.  
  1275. -----------------------------
  1276.  
  1277. From: "Antony A. Courtney" <acourtny@unix1.tcd.ie>
  1278. Subject: Re: reliable signals under BSD / SVR4
  1279. Keywords: signals, reliable, software interrupts
  1280. Date: 3 Sep 92 21:48:54 GMT
  1281. Sender: "NN required at ashe.cs.tcd.ie" <usenet@cs.tcd.ie>
  1282. Nntp-Posting-Host: unix1.tcd.ie
  1283. To:       info-unix@sem.brl.mil
  1284.  
  1285. I have received a few good responses to my post, informing me that "reliable"
  1286. signals only guarantee "at least once" semantics on signal delivery.  This
  1287. should have been obvious to me since the kernel just keeps a mask of pending
  1288. signals for the process, and it is rather difficult to keep a "count" of
  1289. signals delivered with just a single bit.
  1290.  
  1291. Has anyone investigated other models for signal delivery?  Since signals are
  1292. meant to be analogous to interrupts, wouldn't it be useful to guarantee that
  1293. all signals sent are processed?  I would think this would be particularly
  1294. useful for programs that request async. I/O on a descriptor.
  1295.  
  1296. Come to think of it, doesn't it make it somewhat "tricky" to use async. I/O at
  1297. all?
  1298.  
  1299. If you do:
  1300.  
  1301.     ...
  1302.     fcntl() to mark socket for async. i/o;
  1303.     fcntl() to mark socket for non-blocking i/o;
  1304.     signal(SIGIO,handler);
  1305.     ...
  1306.  
  1307. handler(int sig)
  1308. {
  1309.     /* SIGIO implies we have something to read.  Since we may get
  1310.      * more of them while processing this one, read as much as we
  1311.      * can.
  1312.      */
  1313.     while (1) {
  1314.         if (read(fd,BUFSIZE,&buf) < 0) {
  1315.             if (errno==EWOULDBLOCK) {
  1316.                 /* nothing left to process */
  1317.                 break;
  1318.             } else {
  1319.                 perror("read");
  1320.                 exit(1);
  1321.             }
  1322.         }
  1323.         store the buffer somewhere;
  1324.     }
  1325. }
  1326.  
  1327. This code has an obvious race condition, since the check for EWOULDBLOCK and
  1328. the return from the signal handler is non-atomic.  If data arrives on the
  1329. descriptor between the time of checking for EWOULDBLOCK and returning from
  1330. the signal handler, the SIGIO will not be delivered since there is already
  1331. one pending.  This will leave unprocessed data pending in the buffer for the
  1332. descriptor.
  1333.  
  1334. There are some "hacks" to get around this, if you're environment lets you
  1335. write the centralized control loop for the program.  But usually SIGIO is
  1336. useful in cases where that isn't possible, e.g. when using an X toolkit.
  1337.  
  1338. Comments?
  1339.  
  1340.     -antony
  1341. --
  1342. ********************************************************************************
  1343. * Antony A. Courtney                              Email: acourtny@unix1.tcd.ie *
  1344. * Computer Science Department                            antony@george.lbl.gov *
  1345. * Trinity College, Dublin, Ireland                Phone: 01+353+1-607389       *
  1346.  
  1347. -----------------------------
  1348.  
  1349.  
  1350. End of INFO-UNIX Digest
  1351. ***********************
  1352.