home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / shell / 3512 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  1.4 KB

  1. Path: sparky!uunet!usc!rpi!zaphod.mps.ohio-state.edu!darwin.sura.net!nntp.msstate.edu!emory!ogicse!plains!news.u.washington.edu!carson.u.washington.edu!donn
  2. From: donn@carson.u.washington.edu (Donn Cave)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: recursive mkdir
  5. Message-ID: <1992Aug18.161744.27823@u.washington.edu>
  6. Date: 18 Aug 92 16:17:44 GMT
  7. References: <1992Aug12.234645.2589@newshost.lanl.gov> <glaze.093@glaze> <1992Aug18.033048.7574@physiol.su.OZ.AU>
  8. Sender: news@u.washington.edu (USENET News System)
  9. Organization: University of Washington
  10. Lines: 27
  11.  
  12. john@physiol.su.OZ.AU (John Mackin) writes:
  13.  
  14. | I get really tired of people who don't understand portability.
  15.  
  16. Ain't it the truth.  Alas, however, all it takes is some obscure old feature
  17. that you won't find on any platform at your disposal.  The script you posted
  18. fails under DYNIX 3.1, on a Sequent Symmetry:
  19.  
  20.  $ sh mkdir ding/dong/ding/dong
  21.  mkdir: ding/dong/ding/dong: No such file or directory
  22.  mkdir: mkdir failed in directory /u1/donn
  23.  
  24. This is basically a BSD 4.2 system, and the shell is so old that not only
  25. does it lack shell functions, it also behaves a bit different with separator
  26. characters.  My recollection is that it specifically exempts "/" from the
  27. separator characters when expanding expressions, for some reason.
  28.  
  29. | IFS="/$IFS"
  30. ...
  31. |    for d in $arg
  32. |    do
  33. |    if test ! -d $d
  34. |    then
  35. |        if mkdir $d
  36.  
  37.     Donn Cave, University Computing Services, University of Washington
  38.     donn@cac.washington.edu
  39.