[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "make check" failure [with "." at beginning of PATH]
From: |
Bruno Haible |
Subject: |
Re: "make check" failure [with "." at beginning of PATH] |
Date: |
Sun, 10 Feb 2008 11:55:53 +0100 |
User-agent: |
KMail/1.5.4 |
Jim Meyering wrote:
> +# Emulate dirname with sed.
> +# This approximation fails when the input is a single-component
> +# absolute directory name like /foo, but that never happens here.
> +approx_dirname_filter = sed 's,^[^/]*$$,.,;s,//*[^/]*$$,,'
Oops, sorry for suggesting a bad approximation. Here's a better one:
approx_dirname_filter = sed
's,^[^/]*$$,.,;s,^/[^/]*$$,/,;s,\([^/]\)//*[^/]*$$,\1,'
Tested like this:
$ { echo abc; echo abc/def ; echo / ; echo /doo; echo /foo/bar; echo //foo; } \
| sed 's,^[^/]*$,.,;s,^/[^/]*$,/,;s,\([^/]\)//*[^/]*$,\1,'
.
abc
/
/
/foo
//foo
Bruno