Re: sed RE which works on Windows but not Unix
From: Eric Moors (scare.crow_at_oz.land)
Date: 09/10/03
- Next message: Juergen Heck: "Re: Capture what's being passed to a KSH interpreter"
- Previous message: James Leifer: "iterating through files with "for f in *""
- In reply to: Stephen Poley: "sed RE which works on Windows but not Unix"
- Next in thread: David Warren Steel: "Re: sed RE which works on Windows but not Unix"
- Reply: David Warren Steel: "Re: sed RE which works on Windows but not Unix"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 10 Sep 2003 13:32:00 +0200
> (I asked this in comp.editors; they suggested that people here might
> know.)
>
> I have a sed script which includes the following line:
>
> s/\([^!-]\)[ ]*--[ ]*\([^>-]\)/\1\—\2/g
>
> (It replaces '--' with an em-dash character within an HTML file,
> provided it is not part of an HTML comment delimiter.) This works fine
> in my version of sed (3.59 on Windows) but someone else running it on
> Unix gets a 'command garbled' error for this line. I've checked the sed
> FAQ for differences between versions, but failed to spot anything
> relevant.
>
> In comp.editors they suggested that (a) the hyphens should be at the
> beginning of the negated character sets, to prevent confusion with
> ranges; (b) the exclamation mark might need escaping in some sed
> versions. So I tried this, but this still results in:
>
> sed: command garbled: s/\([^-\!]\)[ ]*--[ ]*\([^->]\)/\1\—\2/g
>
> Could anyone suggest what the problem might be, and how to correct it?
shell quoting?
how are you running this command on unix?
- Next message: Juergen Heck: "Re: Capture what's being passed to a KSH interpreter"
- Previous message: James Leifer: "iterating through files with "for f in *""
- In reply to: Stephen Poley: "sed RE which works on Windows but not Unix"
- Next in thread: David Warren Steel: "Re: sed RE which works on Windows but not Unix"
- Reply: David Warren Steel: "Re: sed RE which works on Windows but not Unix"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]