What are environment variables vs shell variables?
BeginnerConceptPackages, Shell & Text Tools
Answer
A shell variable exists only in the current shell. export marks it as an environment variable, copied into every child process's environment.
APP_ENV=prod # shell only
export APP_ENV # now inherited by children
APP_ENV=dev ./run.sh # set only for this one command
env | sort; printenv PATH
unset APP_ENV
Children can never change the parent's environment.
More on Packages, Shell & Text Tools
Compare apt and dnf package management.BeginnerWhat is the difference between `apt upgrade` and `apt full-upgrade`?IntermediateHow do you find which package provides a file or command?BeginnerHow do you pin or hold a package version?IntermediateHow are repositories and their GPG keys configured?AdvancedWhat is the difference between a login shell and an interactive non-login shell?Intermediate