Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!ucsd!rutgers!mephisto!prism!gt0178a From: gt0178a@prism.gatech.EDU (BURNS,JIM) Newsgroups: comp.unix.questions Subject: Re: Cshell question: taking wordlists as a single string Message-ID: <12752@hydra.gatech.EDU> Date: 19 Aug 90 17:17:10 GMT References: <1990Aug18.141141.24890@warwick.ac.uk> Organization: Georgia Institute of Technology Lines: 42 in article <1990Aug18.141141.24890@warwick.ac.uk>, cudcv@warwick.ac.uk (Rob McMahon) says: > I know ksh has `set -A array', but does it have an equivalent of "$@" for > arrays other than the positional paramters ? We don't have ksh, and can't > afford to get it, but when bash gets a bit more solid I will switch to it if > it has an equivalent of csh's $array:q. The following script is followed by its corresponding output (note the set -A is redundant, and its not quite as convenient as in csh, where 'arr= (one two three) sets $arr[1], $arr[2], and $arr[3] in one fell swoop): set -x arr="one two three" echo $arr echo ${arr[0]} echo ${arr[1]} arr[1]="four five six" echo ${arr[1]} echo ${arr[0]} echo ${arr[*]} echo ${#arr[*]} + arr=one two three + echo one two three one two three + echo one two three one two three + echo + arr[1]=four five six + echo four five six four five six + echo one two three one two three + echo one two three four five six one two three four five six + echo 2 2 -- BURNS,JIM Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332 uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a Internet: gt0178a@prism.gatech.edu