Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!ames!aurora!labrea!jade!ucbvax!YALE.ARPA!ram-ashwin From: ram-ashwin@YALE.ARPA.UUCP Newsgroups: comp.sys.apollo Subject: Re: Dynamic Allocation in an Aegis Script ??? Message-ID: <8711181852.AA07619@ELI.CS.YALE.EDU> Date: Wed, 18-Nov-87 13:52:26 EST Article-I.D.: ELI.8711181852.AA07619 Posted: Wed Nov 18 13:52:26 1987 Date-Received: Sat, 21-Nov-87 14:47:03 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 30 > I have here an Aegis script that prompts a user for a number which > is used in part to create variables "dynamically". These variables are > created by concatenating a string prefix to the loop counter number. > The problem is that I can't evaluate it in the same manner. > ... > # How do you print the value of these 'dynamic' variables ?? > #These two statement print the string "vari" where i=number you entered. Try this: ------------------------------------------------------------------------------ #!/com/sh eon read -prompt "Enter number of elements:" -type integer num for n := 0 to ^num "var^n" := ^n endfor read -prompt "Enter desired element:" -type integer i /com/sh "args @"The value of var^i is @^var^i@"" ------------------------------------------------------------------------------ I set up the command I want executed (the args command) which includes the name of the variable I want, and then I 'eval' it using /com/sh. -- Ashwin Ram -- ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,linus,seismo}!yale!Ram-Ashwin BITNET: Ram@yalecs