![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Array in loop is acting up | RisingSun | Shell Programming and Scripting | 5 | 08-07-2008 02:21 PM |
| reading from within the loop --std i/p problem | mobydick | Shell Programming and Scripting | 2 | 07-11-2008 08:42 PM |
| How to use array values after the loop. | Devesh5683 | Shell Programming and Scripting | 1 | 05-13-2008 07:38 PM |
| Array Declaration and For Loop | 33junaid | Shell Programming and Scripting | 4 | 09-15-2007 04:16 PM |
| Reading data into muti-dimentional array - in perl | zap | Shell Programming and Scripting | 5 | 05-04-2004 10:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Reading from while loop into an array
Hi
I have something like cat $HOME/all_dirs | while read ln_old_dirs do if [ "$ln_all_old_dirs" != "" ] then echo "$ln_all_old_dirs" fi done As you know that the variable ln_all_old_dirs is not accessable from outside the while loop How to assign it in an array so that i can use it outside It would be of great help Thanks in advance Suresh |
|
||||
|
Hi nilesh
Thanks for your reply but mine is not fixed array it can have any number of entries greater than zero array=($ln_all_old_dirs) len=${#array[*]} echo "The array has $len members. They are:" i=0 while [ $i -lt $len ]; do echo "$i: ${array[$i]}" let i++ done This is not working for me moreover my main question is how to access set of values that is array outsid the loop |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|