Article View: comp.unix.shell
Article #97What's wrong with this sed command?
From: Skip Montanaro
Date: Tue, 21 Jul 1992 21:03
Date: Tue, 21 Jul 1992 21:03
24 lines
1303 bytes
1303 bytes
I'm trying to use sed to trim off all leading "./" patterns from source
filenames in make rules. On an IBM RS6000 the following works as I expected:
echo 'enquire.o: ./././enquire.c' | sed 's?: \(\./\)\{1,\}?: ?'
yielding
enquire.o: enquire.c
On our other systems (Sun-4, HP, SGI, and Motorola 68040) it prints
different results. The HP doesn't trim any "./" patterns, while the Sun,
Moto, and SGI all trim one pattern.
Have I incorrectly specified the sed command or are one (or more) of the
vendors' sed implementations incorrect? If so, which one(s)? I'm inclined to
believe the IBM is correct and the others are bugged.
(I suppose this is another argument for perl...)
Thanks,
--
Skip (montanaro@crd.ge.com)
Technical Details
Message-ID:
<MONTNARO.92Jul21160321@ausable.crd.ge.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!crdgw1!rdsunx.crd.ge.com!rdsunx!montnaroShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!crdgw1!rdsunx.crd.ge.com!rdsunx!montnaro From: montnaro@ausable.crd.ge.com (Skip Montanaro) Newsgroups: comp.unix.shell,comp.unix.questions Subject: What's wrong with this sed command? Message-ID: <MONTNARO.92Jul21160321@ausable.crd.ge.com> Date: 21 Jul 92 21:03:21 GMT Sender: usenet@crd.ge.com (Required for NNTP) Reply-To: montanaro@crd.ge.com (Skip Montanaro) Followup-To: poster Distribution: comp Organization: GE Corporate Research & Development, Schenectady, NY Lines: 24 Nntp-Posting-Host: ausable.crd.ge.com