Hi -

Here's a couple of scripts, stripped down to bare bones and tested on
several recent bash versions; both cause a crash, with the following errors
in all cases:

./borked1: line 6: n/core-default.xml: expression recursion level exceeded
(error token is "n/core-default.xml")
./borked2: line 6: on/core-default.xml: division by 0 (error token is
"-default.xml")

Scripts (these differ by only one character, 'for n in n/' vs. 'for n in
on/'):

----------------------------------------------------------------------------------------------------------------------
#!/bin/bash

declare -A x
x[/etc/hadoop/conf/core-default.xml]=x

for n in n/core-default.xml
do
    f="/etc/hadoop/conf/`basename $n`"
    if [ -n "${x[$f]}" ]; then for m in ${foo[$n]}; do echo; done
    fi
done
----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------
#!/bin/bash

declare -A x
x[/etc/hadoop/conf/core-default.xml]=x

for n in on/core-default.xml
do
    f="/etc/hadoop/conf/`basename $n`"
    if [ -n "${x[$f]}" ]; then for m in ${foo[$n]}; do echo; done
    fi
done
----------------------------------------------------------------------------------------------------------------------


Best regards,
-- 
Ben Okopnik

Reply via email to