Monday, July 7, 2014

Examine shell and environment variables using set command

Set Command is different from the printenv environment is that the Set Command display both the shell and environment environment. One interesting feature is that it display the output in alphabet order. For more information on printenv. See Examine the Linux Environment using printenv

$ set | less

AMBERHOME=/usr/local/amber10
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="2" [2]="25" [3]="1" [4]="release" [5]="x86_64-redhat-linux-gnu")
BASH_VERSION='3.2.25(1)-release'
COLORS=/etc/DIR_COLORS.xterm
COLUMNS=157
CVS_RSH=ssh
DIRSTACK=()
EUID=500
GROUPS=()
G_BROKEN_FILENAMES=1
HISTFILE=/home/me/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/home/me
HOSTNAME=headnode.cluster.com
HOSTTYPE=x86_64
IFS=$' \t\n'
INPUTRC=/etc/inputrc
LANG=en_US.UTF-8
LD_LIBRARY_PATH=......
LESSOPEN='|/usr/bin/lesspipe.sh %s'
LINES=46
LOADEDMODULES=
LOGNAME=me
LS_COLORS='no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:'
MACHTYPE=x86_64-redhat-linux-gnu
MAIL=/var/spool/mail/me
MAILCHECK=60
MANPATH=:/opt/xcat/share/man:
MKL_HOME=/opt/intel/mkl/10.2.6.038
....
....
....
....
....

No comments: