Today we will explore the difference between
Both snippets define variables but...
export, the shell variable scope is restricted to the shell, remaining available to any other process.
NAME=value for temporary or loop variables private to the current shell process.
export makes the shell variable available to child processes via the environment, turning it into an environment variable.
export NAME=value for settings and variables that have meaning to a sub-process.
When you want to make the value of a variable accessible in subshells, the shell's
export command should be used.
# Create a shell variable AGE=30 # Turn the shell variable into an environment variable export AGE