home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3079 < prev    next >
Encoding:
Internet Message Format  |  1992-07-21  |  1.3 KB

  1. Xref: sparky comp.unix.shell:3079 comp.unix.questions:9252
  2. Path: sparky!uunet!crdgw1!rdsunx.crd.ge.com!rdsunx!montnaro
  3. From: montnaro@ausable.crd.ge.com (Skip Montanaro)
  4. Newsgroups: comp.unix.shell,comp.unix.questions
  5. Subject: What's wrong with this sed command?
  6. Message-ID: <MONTNARO.92Jul21160321@ausable.crd.ge.com>
  7. Date: 21 Jul 92 21:03:21 GMT
  8. Sender: usenet@crd.ge.com (Required for NNTP)
  9. Reply-To: montanaro@crd.ge.com (Skip Montanaro)
  10. Followup-To: poster
  11. Distribution: comp
  12. Organization: GE Corporate Research & Development, Schenectady, NY
  13. Lines: 24
  14. Nntp-Posting-Host: ausable.crd.ge.com
  15.  
  16.  
  17. I'm trying to use sed to trim off all leading "./" patterns from source
  18. filenames in make rules. On an IBM RS6000 the following works as I expected:
  19.  
  20.    echo 'enquire.o: ./././enquire.c' | sed 's?: \(\./\)\{1,\}?: ?'
  21.  
  22. yielding
  23.  
  24.    enquire.o: enquire.c
  25.  
  26. On our other systems (Sun-4, HP, SGI, and Motorola 68040) it prints
  27. different results. The HP doesn't trim any "./" patterns, while the Sun,
  28. Moto, and SGI all trim one pattern.
  29.  
  30. Have I incorrectly specified the sed command or are one (or more) of the
  31. vendors' sed implementations incorrect? If so, which one(s)? I'm inclined to
  32. believe the IBM is correct and the others are bugged.
  33.  
  34. (I suppose this is another argument for perl...)
  35.  
  36. Thanks,
  37.  
  38. --
  39. Skip (montanaro@crd.ge.com)
  40.