[BusyBox] Ash *surprises*

David Douthitt ssrat at mailbag.com
Fri Aug 10 10:35:06 UTC 2001


"Vladimir N. Oleynik" wrote:

> > 6. IFS="," ; set -- $FOO ...where FOO="a, b, c, d" acts differently:
> >    ash:    returns: $1=a $2=b $3=c $4=d
> >    bb ash: returns: $1=" a" $2=" b" $3=" c" $4=" d"
> >    ...setting IFS to ", " restores the desired behavior.
> 
> This not quick correct...

Now I'm REALLY confused.... I created a test script:

# cat test.ifs

show () {
        for i in "$@" ; do
                echo -n "/$i/ "
        done
        echo
        }

TEST="a, b, c"

IFS="," ; set -- $TEST

if [ "$1" = "a" ] && [ "$2" = "b" ] && [ "$3" = "c" ] ; then
        exit 0
fi

show "$@"
exit 1

...now on a Mandrake 8 system that includes bash, ash, and pdksh, all
return:

# ./test.ifs
/a/ / b/ / c/ 

With the older non-busybox ash, it also returned that, but had the
expected (but annoying) trait of displaying the entire file as it went. 
I'd forgotten it did that; if busybox ash doesn't do that it would be
nice ;-)

I don't know where this business came from; I KNOW I saw that behavior,
but it's not there anywhere I look now.  Can't fix it if you can't find
it - and if everybody else does it that way, maybe it doesn't need
fixing....





More information about the busybox mailing list