shellunixscripting

Shell Variable capacity


Suppose i have a shell script in which there is a statement like :

a=$(find / -type f)

This says there is a certain list of files with their file paths which will be stored in the variable 'a'.

What is the maximum limit or number of lines that it can store. How do I find it?


Solution

  • IIRC, bash does not impose a limit on how much data a variable can store. It is however limited by the environment that bash was executed under. See this answer for a more comprehensive explanation.