Path: utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.questions Subject: arrays in sh (was: Novice questions about shell syntax) Message-ID: <7258@star.cs.vu.nl> Date: 8 Aug 90 15:59:11 GMT References: <637@travis.csd.harris.com> Sender: news@cs.vu.nl Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Dept. of Computer Science, Amsterdam, The Netherlands Lines: 20 In article <637@travis.csd.harris.com>, brad@SSD.CSD.HARRIS.COM (Brad Appleton) writes: )... ) 2) set a shell variable to a word-list (or an array) )... ) sh ksh csh ) ------------------- ---------------------- -------------------------- )... )2) N/A set -A name el1 el2 ... set name=( el1 el2 ... ) To emulate arrays in sh the following constructs can be used: # to set `array[index]' eval array$index=\$value # to retrieve it eval value=\$array$index -- "UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." (Doug Gwyn)