Re: shell compatibility issues with SunOS 5.10
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- May 6, 2009, 06:57 UTC
- Message-ID
- <fcaeb9bf0905052357v6773cbf5i12795c1866a80783@mail.gmail.com>
- In-Reply-To
- <4A01320A.2050600@viscovery.net>
On Wed, May 6, 2009 at 4:45 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 21 quoted lines
> Nguyen Thai Ngoc Duy schrieb: >> I did "make test" on a SunOS 5.10 and it failed. With the below patch, >> only t7400 and t8005 kept failing. For the first case, t7400.5 failed >> because extensive use of sed to normalize path in git-submodule.sh >> >> # normalize path: >> # multiple //; leading ./; /./; /../; trailing / >> path=$(printf '%s/\n' "$path" | >> sed -e ' >> s|//*|/|g >> s|^\(\./\)*|| >> s|/\./|/|g >> :start >> s|\([^/]*\)/\.\./|| >> tstart >> s|/*$|| >> ') > > There was a lengthy thread that lead to this version of the sed > expression. Could you please tell what your sed has to say about it? It > works even on AIX 4.3.3.
It says nothing. The result of "printf '%s\n' ./foo/bar | sed -e blah" is just wrong, (i.e. "./" remains). I stripped down to "sed -e 's|^\(\./\)*||'", does not work. Probably due to \( \) pair. Skimmed through sed manpage, seems no mention of bracket grouping.
-- Duy