Environment VariablesEvery instance of a shell, and every process that is running, has its own “environment" settings that give it a particular look, feel, and, in some cases, behavior. These settings are
typically controlled by environment variables. Some environment variables have special meanings to the shell, but there is nothing stopping you from defining your own and using them for your own needs. It is through the use of environment variables that most shell scripts are able to do interesting things and remember results from user inputs as well as program outputs.
Printing Environment VariablesTo list all of your environment variables, use the printenv command. For example,
[yyang@fedora-serverA ~]$ printenv
HOSTNAME=fedora-serverA.example.org
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
...
No comments:
Post a Comment