[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#88413: PATCH]: modconf broken with ash



David Whedon <dwhedon@gordian.com> wrote:

> -    if [ -z "$BASH_VERSION" ]; then
> -      tdir=`echo $directory | tr / _`
> -    else
> -      tdir=${directory//\//_}
> -    fi
> +    tdir=`echo $directory | tr / _`

Here's a way to do it that works with any POSIX shell (make sure that the
shell arguments are not needed later or save them):

OIFS="$IFS"
IFS=/
set -f
set $directory
set +f
IFS=_
tdir="$*"
IFS="$OIFS"
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



Reply to: