Hi!

----

Does anyone know why the following fails in ast-ksh.2012-07-27 when I
use $a/$b instead of plain numbers below ?
This works...
-- snip --
$~/bin/ksh -c 'typeset -a ar=( [0]=( [0]=a [1]=b [2]=c ) ) ; integer
a=1 b=2 ; print "${ar[0][1..2]}"'
b c
-- snip --
... but if I replace "1" and "2" with ${a} and ${b} I get an error:
-- snip --
$ ~/bin/ksh -c 'typeset -a ar=( [0]=( [0]=a [1]=b [2]=c ) ) ; integer
a=1 b=2 ; print "${ar[0][${a}..${b}]}"'
/home/gisburn/bin/ksh: ${b}]}": arithmetic syntax error
-- snip --

Note that this works...
-- snip --
$ ksh -c 'typeset -a ar=( [0]=a [1]=b [2]=c ) ; integer a=1 b=2 ;
print "${ar[$a..$b]}"'
b c
-- snip --
... but this fails:
-- snip --
$ ~/bin/ksh -c 'typeset -a ar=( [0]=a [1]=b [2]=c ) ; integer a=1 b=2
; print "${ar[${a}..${b}]}"'
/home/gisburn/bin/ksh: ${b}]}": arithmetic syntax error
-- snip --

My problem is that "a" and "b" should be inside a compound variable so
the '}'/'{' are not avoidable (yes, I know... use "nameref"'s ...) ...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.ma...@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to