From: Dennis Stosberg Date: Thu, 06 Jul 2006 14:25:33 GMT Subject: Re: [PATCH 1/3] configure: Add test for Perl Message-ID: <20060706142532.G37e44125@leonov.stosberg.net> In-Reply-To: <20060706141725.28115.qmail@775c2aaf180a85.315fe32.mid.smarden.org> Gerrit Pape wrote: > This should work with shell/builtins only, no sed/cut: > > path=${PATH}: > while test -n "$path"; do > p=${path%%:*}/$1 > test ! -x "$p" || { echo "$p"; return 0; } > path=${path#*:} $ exec /bin/sh $ uname -a SunOS hostname 5.9 Generic_118558-25 sun4u sparc SUNW,Ultra-5_10 Solaris $ echo ${PATH%%:*} bad substitution $ echo ${PATH#*:} bad substitution Regards, Dennis