Linux Kernel 3.10을 기준으로 보면,

Maximum number of environment variable in Linux : 0x7fffffff

Maximum string length of environment variable and argument: PAGE_SIZE * 32 (4K page의 경우 128K)


헛갈리기 쉬운 것 (용어를 명확하게 사용하고 있지 않은 것들.)

"environment variable" vs "shell variable"

 

Bash 기준으로 보면

 

export var=hello  # This is environment variable

var=hello   # This is shell variable.


즉, environment variable 이란 descendent process들에게 영향을 미치는 '환경'을 의미한다. Current process에서만 유효한 것은 environment variable이라 부를 수 없다.

추가적으로, '$ env' command를 수행할 때 나오는 값들 역시 environment variable만 나오고 shell variable은 나오지 않는다.


+ Recent posts