* Dave Korn wrote on Wed, Aug 26, 2009 at 12:38:50PM CEST: > Paolo Bonzini wrote: > > $ sed -e 's,/\(\./\)\{1\,\},/,g;s,/\.$,/,' > > ./foo/bar/./baz > > ./foo/bar/baz > > > > $ sed -e 's,/\(\./\)\{1,\},/,g;s,/\.$,/,' > > sed: -e expression #1, char 18: unknown option to `s' > > > > $ > > Maybe the best thing would be to change it to use a different separator? > Ralf, have we discovered a new item for the autoconf man page "portable shell" > chapter?
Not really: Patterns should not include the separator (unless escaped), even as part of a character class. In conformance with Posix, the Cray `sed' rejects `s/[^/]*$//': use `s,[^/]*$,,'. [...] Portable `sed' regular expressions should use `\' only to escape characters in the string `$()*.0123456789[\^n{}'. Sorry for not catching this. Cheers, Ralf