1

Environment variable and shell variable difference

view story
linux-howto

http://unix.stackexchange.com – I have searched stackexchange and other website for the difference. It is said that environment variable is inherited in child processes but shell variables are not. However the following test shows shell variables are seen in child process just as environment variables. Any suggestion please? Thank you. > bash --version GNU bash, version 3.2.39(1)-release (x86_64-suse-linux-gnu) Copyright (C) 2007 Free Software Foundation, Inc. > export TEST="ENV_TEST" #env var > sh -c "echo \$TEST" ENV_TEST > TEST="SHELL_TEST" #shell var > sh -c "echo \$TEST" #shell var is se (HowTos)