![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Feb 2006
Location: 127.0.0.1
Posts: 35
Rep Power: 0
![]() |
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]}echo ${array_varible[1]}hush |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4
![]() |
try:
let i=0
while (( i < ${#Arr[*]} ))
do
echo "${Arr[i]}"
let i=i+1
done |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Feb 2006
Location: 127.0.0.1
Posts: 35
Rep Power: 0
![]() |
word up.
that works like a dream. nice one. i was trying to use it in a while loop as well. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|