On Sun, May 08, 2016 at 04:34:52PM +0200, Fabian Raetz wrote:
> Hi,
>
> while porting git-flow [0] to OpenBSD i've found that the following two
> examples behave differently in bash(1) and ksh(1).
>
>
> subst.sh
> -------------
> echo "$1, $2, ${1#$2}"
> echo "$1, $2, ${1%$2}"
>
> $ bash subst.sh -start- -
> -start-, -, start-
> -start-, -, -start
>
>
> $ ksh subst.sh -start- -
> -start-, ,
> -start-, ,
I've copied the wrong output -_- the actual output is:
-start-, -,
-start-, -,
>
>
> Notice that in ksh(1), "${1#$2}" and "${1%$2}" do not return the
> substituted string. I that expected and i misinterpret the manual or
> is this a bug in ksh(1).
>
> Cheers,
> Fabian
>
> PS: I'm running OpenBSD wifilab.home 5.9 GENERIC.MP#2004 amd64
>
> [0] https://github.com/petervanderdoes/gitflow-avh