[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval
From: |
DJ Mills |
Subject: |
Re: eval |
Date: |
Tue, 3 May 2011 23:17:57 -0400 |
On Tue, May 3, 2011 at 10:41 PM, Jonathan Nieder <jrnieder@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}"
- eval, Rafael Fernandez, 2011/05/05
- Re: eval, Jonathan Nieder, 2011/05/03
- Re: eval,
DJ Mills <=
- Re: eval, Rafael Fernandez, 2011/05/05
- Re: eval, Jonathan Nieder, 2011/05/04
- Re: eval, Andreas Schwab, 2011/05/04
- Re: eval, Rafael Fernandez, 2011/05/05
- Re: eval, Chet Ramey, 2011/05/05
- Re: eval, Eric Blake, 2011/05/05
- Re: eval, Chet Ramey, 2011/05/05
- Re: eval, Eric Blake, 2011/05/05
- Re: eval, Chet Ramey, 2011/05/05
- Re: eval, Sven Mascheck, 2011/05/05