Reputation: 11
I am working on a requirement where I am assigning multiple paths to environment variable in unix for searching in different directories. as below.
export TB_SCC= .:/users/e649744/WTEST/AB:/users/e649744/WTEST/BC:/users/e649744/WTEST/CD:/users/e649744/WTEST/BC:/users/e649744/WTEST/DE:/users/e649744/WTEST/EF:/users/e649744/WTEST/FG:/users/e649744/WTEST/GH:/users/e649744/WTEST/HI:/users/e649744/WTEST/JK:/users/e649744/WTEST/LM
So is there a size limit/restriction for environment variable in unix? IS there a fixed limit after which it will not accept the value?
Please help.
Upvotes: 1
Views: 79
Reputation: 188114
Try getconf:
$ getconf ARG_MAX
ARG_MAX: Maximum length, in bytes, of the arguments for one of the exec subroutines, including environment data.
On my machine this currently yields 2MB, probably more than enough for most cases:
2097152
See also: getconf Command
Upvotes: 1