On Saturday 03 October 2009 19:11, Cristian Ionescu-Idbohrn wrote:
> On Fri, 2 Oct 2009, Cristian Ionescu-Idbohrn wrote:
>
> > Consider this script:
> >
> > ---8<---
> > #!/bin/sh
> >
> > set -e
> > #set -x
> >
> > echo "1. \$1='$1', size \${#\$1}=${#$1}" >&2
> > echo "2. \$2='$2', size \${#\$2}=${#$2}" >&2
> > echo "3. \$3='$3', size \${#\$3}=${#$3}" >&2
> >
> > echo "4. \$1='$1', size \${#1}=${#1}" >&2
> > --->8---
> >
> > Expecting error 'bad substitution' on 1., 2. and 3. I get:
> >
> > size=5
> >
> > instead, no error.
>
> Would the attached patch be an apprpriate bugfix for the above?
No, it breaks valid constructs like this one:
echo "0. \$\$='$$', size \${#\$}=${#$}" >&2
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox