Hi I have to capture a file into an array and then pass that array into the while loop.

I just don't want to execute my script with below while loop because it is taking long time...

```
while read line; do

some actions...

done < file.txt

```

My server has 8 GB ram and out of which 6 GB is always available. So please let me know weather it is a good idea to capture the file of size 100 MB into memory (array) and do operations like grep,sed,awk and etc on it.

If So please let me know how to capture file into array.

If not kindly suggest me another way to increase performance.