![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Array inside an array | manas_ranjan | UNIX for Advanced & Expert Users | 5 | 06-10-2008 11:25 AM |
| array | ccp | Shell Programming and Scripting | 3 | 02-26-2008 12:19 AM |
| I need help with an array! | djsal | Shell Programming and Scripting | 1 | 11-28-2007 08:26 AM |
| create array holding characters from sring then echo array. | rorey_breaker | Shell Programming and Scripting | 5 | 09-28-2007 05:42 AM |
| Do I need an array here? | TheCrunge | Shell Programming and Scripting | 5 | 04-19-2005 12:20 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
using array
how can i list and store all the results into an array?
say for example listing of file names and storing them individually into an array. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
#!/bin/ksh
set -A filesA $(find . -type f 2>/dev/null)
typeset -i i=0
while (( $i < ${#filesA[*]} ))
do
echo "index->[${i}] value->[${filesA[$i]}]"
((i+=1))
done
|
|
#3
|
|||
|
|||
|
apologies, but i am running under the bourne shell
|
|
#4
|
|||
|
|||
|
There is no array datatype in Bourne shell. Change to something more recent.
bakunin |
|||
| Google The UNIX and Linux Forums |