Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Bash / Shell Scripting (http://www.programmingforums.org/forum26.html)
-   -   ksh array (http://www.programmingforums.org/showthread.php?t=10333)

hush Jun 13th, 2006 12:01 PM

ksh array
 
I am currently creating a ksh script with an array.

I was wondering if it was some how possible to call an element of an array with a variable:

e.g something like this, but not this as it does not work:

:

echo ${array_varible[$x]}
rather then:

:

echo ${array_varible[1]}
any feed back would be great

hush

jim mcnamara Jun 13th, 2006 2:37 PM

try:
:

let i=0
while (( i < ${#Arr[*]} ))
do
  echo "${Arr[i]}"
  let i=i+1
done


hush Jun 14th, 2006 11:15 AM

word up.

that works like a dream. nice one.

i was trying to use it in a while loop as well.


All times are GMT -5. The time now is 8:06 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC