Contents /
Previous /
Next
Environment Variables
All environment variables (
PATH, USER, HOSTNAME, ...)
are visible from within a shell script.
Use the command env to list them.
To make a VARIABLE accessible in a child shell use:
export VARIABLE="____"
A shell can also be opend with modified
values for environment paramters:
USER=test my_script.sh
With my_script.sh:
#!/bin/sh
echo user: $USER
But changing a variable in a child shell
does not change its value in the parent shell!