From ca0cb170119b3cef4ccdfc743b6c225e9e6eed53 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 17 Nov 2015 17:44:12 +0000 Subject: 37128: work around alias expansion trashing subscript parsing --- Test/D06subscript.ztst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Test/D06subscript.ztst') diff --git a/Test/D06subscript.ztst b/Test/D06subscript.ztst index cffca742e..144923667 100644 --- a/Test/D06subscript.ztst +++ b/Test/D06subscript.ztst @@ -249,3 +249,20 @@ string[0]=! 1:Can't set only element zero of string ?(eval):1: string: assignment to invalid subscript range + + typeset -A assoc=(leader topcat officer dibble sidekick choochoo) + alias myind='echo leader' myletter='echo 1' myletter2='echo 4' + print ${assoc[$(myind)]} + print $assoc[$(myind)] + print ${assoc[$(myind)][$(myletter)]}${assoc[$(myind)][$(myletter2)]} + assoc[$(myind)]='of the gang' + print ${assoc[$(myind)]} + print $assoc[$(myind)] + print $assoc[leader] +0: Parsing subscript with non-trivial tokenisation +>topcat +>topcat +>tc +>of the gang +>of the gang +>of the gang -- cgit 1.4.1