In Unix/Linux, you can print the values of environment variables using the echo
command and the syntax $[variable_name]
. Here’s an example to print the value of the PATH
environment variable:
echo $PATH
To print the values of all environment variables, you can use the printenv
or env
command:
printenv
or
env
This will print the values of all environment variables, one per line. You can use the output of this command to see the current values of the environment variables and use that information to make decisions in your shell scripts.