Shell- und Umgebungsvariablen

variable=42
bash -c 'echo $variable'
export variable
bash -c 'echo $variable'
echo 'export variable1=23' >> /etc/profile
echo 'export variable2=23' >> ~/.bashrc
echo 'export variable3=23' >> ~/.bash_profile
export variable=23
env | grep ^variable

Links