Thanks, I wasn't aware that positional parameters greater than nine have to be enclosed in brackets.
On Tue, May 3, 2011 at 10:17 PM, DJ Mills <danielmil...@gmail.com> wrote: > > > On Tue, May 3, 2011 at 10:41 PM, Jonathan Nieder <jrnie...@gmail.com>wrote: > >> Hi Rafael, >> >> Rafael Fernandez wrote: >> >> > set -- a b c d e f g h i j k l m n o p q r s t u v w x y z >> > i=1 >> > eval echo '$'$i # outputs an expected 'a' >> > i=10 >> > eval echo '$'$i # outputs 'a0'; expected 'j' >> > i=11 >> > eval echo '$'$i # outputs 'b1'; expected 'k' >> >> Have you tried >> >> eval "echo \${$i}" >> >> ? >> >> That has nothing to do with eval. The only way to explicitly expand a > positional > parameter > 9 is to use braces, echo "${10}" > -- PGP Key ID 0x1AE8B32A<http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBF2AE4D81AE8B32A>