$* and $@ exhibit same behaviour -> those of $*

rank1seeker at gmail.com rank1seeker at gmail.com
Mon Dec 3 17:09:55 UTC 2012


I've noticed this under 9.0-RELEASE-p5


#!/bin/sh
#####################################################
ftest_dot ()
{
    local i

    for i in $*
    {
        echo "$i"
    }
}

ftest_monkey ()
{
    local i

    for i in $@
    {
        echo "$i"
    }
}


echo ============
ftest_dot one 'spaced path' two ''
echo ============
ftest_monkey one 'spaced path' two ''
echo ============

exit 55



Output:
-------
============
one
spaced
path
two
============
one
spaced
path
two
============


Expected output is:
-------------------
============
one
spaced
path
two
============
one
spaced path
two
============


I hope fix'll get into 9.1



Domagoj Smolčić


More information about the freebsd-hackers mailing list