How to see a list of all exported variables and functions under Unix bash shell. The export
command makes your local variables global.
# -----------------------------------------------------------------------------
# Linux / Unix: Bash Shell See All Exported Variables and Functions
# http://www.cyberciti.biz/faq/linux-unix-bash-shell-see-all-exported-variables-and-functions/
# -----------------------------------------------------------------------------
# The export command makes your local variables global.
# The syntax is as follows:
export PATH=$PATH:/usr/local/bin:~/bin
export EDITOR=/usr/local/bin/vim
export SHELL=/bin/ksh
export LANG=En_US
export PAGER=/usr/local/bin/most
# To make your local shell variables global automatically, export them in
# your ~/.profile or ~/.bash_profile file under Unix like operating systems.
# To see a list of all exported variables and functions pass the -p option
# to the export command:
export -p
export -p | grep something
export -p | less
export -p | more
# ----------------------
# Sample outputs:
# ----------------------
#
# DISPLAY=unix:0
# EDITOR=vim
# HISTFILE=/home/vivek/.bash_history
# HISTSIZE=1000
# HOME=/home/vivek
# LANG=En_IN
# LOGNAME=vivek
# MAIL=/usr/mail/vivek
# MAILCHECK=0
# PWD=/home/vivek
# SHELL=/bin/bash