.sh for loop

RW rwmaillists at googlemail.com
Tue Jun 22 01:03:14 UTC 2010


On Tue, 22 Jun 2010 07:20:00 +0800
Aiza <aiza21 at comclark.com> wrote:


> >    test "$name" = "${path}/${group}*" && continue
> >    [ -z "${found_list}" ] && found_list="${name}" ||


> I had not known about the 'test' command.
> You have taught me something new.

In case you're not aware, [ -z "${found_list}" ] is also using
test. /bin/test and /bin/[ are hard-linked. So the following are the
same:
 
test "$name" = "${path}/${group}*" && continue

[ "$name" = "${path}/${group}*" ] && continue


More information about the freebsd-questions mailing list