Buffer size/memory allocation for shell scripts

Hello,

I have a small problem some large shell scripts.
My scripts do lot of text manipulation with large files. But at some point they stuck. The variables in the script lose their value, it becomes null.
I guess this is because of lack of memory. What could be the other reason of variables losing its value?

How can I allocate more ram to shell scripts in linux, or increase the buffer size?

Thanks

I'm sorry, but your diagnosis doesn't sound plausible to me. Do you get any error message? The shell will simply allocate enough memory to hold the variables, and emit an error (and possibly even crash) if it cannot.

Can you prune down your script to a minimal example which exhibits this behavior?