Yes, they can be. It depends on your OS and / or on the shell and shell versions. It is safer to use temporary files if you expect variable values ββto exceed 1-4 KB.
EDIT
Also see What is the maximum size of an environment variable? ; this concerns the OS restriction on the total environ size (the cumulative size of all VARIABLE=VALUE s), which affects the export ed variables, but the shell itself may have its own re restrictions. all (including non- export ed) variable sizes.
Speaking of which, if you do not have mobility, GNU bash relatively good in that it does not limit (not export ed) the size of variables and can very likely store arbitrary amounts of data until malloc can find enough memory and an adjacent address space . :)
vladr
source share