2. Computing environment

Unix Shell

By default user shell is dticsh, it is a symbolic link to /bin/bash. In other servers of the DTIC , 'dticsh' shell is a restricted shell which encapsulates user connections in sftp, rsh or even rsync. All users are defined in DTIC LDAP directory. The environment variable $SHELL shows your shell interpreter:

$ echo $SHELL
/bin/dticsh

Environment variables

By default user common variables printed out by the env command:

ijimenez@login:~$ env
MANPATH=/sge/man:/usr/man
CLUES_PATH=/usr/local/clues/0.89
TERM=xterm
SHELL=/bin/bash
SGE_JSV_TIMEOUT=600
XDG_SESSION_COOKIE=6e0d0fdd5d4d80844f93739852541bee-1387193389.659370-725688603
MODULEPATH_ROOT=/soft/modulefiles
SSH_CLIENT=10.80.1.106 50897 22
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
SGE_CELL=default
SSH_TTY=/dev/pts/4
http_proxy=http://proxy:8080
USER=ijimenez
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
LMOD_sys=Linux
LD_LIBRARY_PATH=/sge/lib/linux-x64
ftp_proxy=http://proxy:8080
LMOD_PREPEND_BLOCK=normal
MAIL=/var/mail/ijimenez
PATH=/sge/bin/linux-x64:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/clues/0.89:/soft/MATLAB/R2013b/bin:/sge/matlab
LMOD_SETTARG_CMD=:
PDSH_RCMD_TYPE=ssh
PWD=/homedtic/ijimenez
LANG=en_US.UTF-8
MODULEPATH=/soft/modulefiles/Linux:/soft/modulefiles/Core:/soft/lmod/lmod/modulefiles/Core
LMOD_SETTARG_SUPPORT=no
SGE_ROOT=/sge
LMOD_CMD=/soft/lmod/lmod/libexec/lmod
SHLVL=1
HOME=/homedtic/ijimenez
LANGUAGE=en_US:en
BASH_ENV=/soft/lmod/lmod/init/bash
LMOD_arch=x86_64
LOGNAME=ijimenez
SSH_CONNECTION=10.80.1.106 50897 193.145.51.37 22
SGE_CLUSTER_NAME=p6444
DISPLAY=localhost:12.0
LMOD_DIR=/soft/lmod/lmod/libexec/
LMOD_COLORIZE=yes
_=/usr/bin/env
ijimenez@login:~$ 

From that extensive list, you'll basically work with the following ones:

HOME=/homedt<CONTAINER>/<USERNAME>
PATH=/homedtXX/username/bin:/sge/bin/linux-x64:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/clues/0.89
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
LD_LIBRARY_PATH=/sge/lib/linux-x64

Additionally, the example above shows some variables that are not included by default: 

MATLAB_JAVA=/soft/jdk1.7.0_40/jre/
PATH=$PATH:/soft/MATLAB/R2013b/bin
OLDPWD=/soft/MATLAB/R2013b/sys/jxbrowser/glnxa64/xulrunner/xulrunner-linux-64

The environment variables are managed by the system and inherited from several places at login time. To add or modify the environment variables, we suggest this way:

Edit the file ~/.bashrc. It is placed on your home directory:

ijimenez@login:~$ vi $HOME/.bashrc

and go to the last lines of the file. In the following example, we'll add the environment variables for the Matlab Java JVM and we'll add Matlab to our application path:

# Create a new environment variable to override Matlab's own Java and use our own:
# -------------------------------------------------------------------------------
export MATLAB_JAVA=/soft/jdk1.7.0_40/jre/
#
# Add the path of matlab's binary to the system PATH
# -------------------------------------------------- 
export PATH=$PATH:/soft/MATLAB/R2013b/bin:/sge/matlab

To process the new version of our .bashrc, we have to logout and login again, as .bashrc is processed on login time.

Modules

The Modules package provides for the dynamic modification of the user's environment via modulefiles.

$ module avail
------------------------- /soft/lmod/lmod/modulefiles/Core ---------------------
 lmod/lmod    python/2.7.5    python/3.3.2   (D)    settarg/settarg    stress/1.0.4    x86_open64/4.5.2.1
The next command show wich modules are available:
$ module spider
module command with parameter show wich packages are available:
$ module spider <modulename>

to load and list modules execute the following command:

$  module load<modulename>
$ module list

The modules tool is useful to load and unload environment variables without worrying about .bashrc, but shows its best behavior if you want to dinamically change from two different installed versions of a package in the system. If you look carefully, you'll see that we have two differetn versions of python, and default is 3.3.2:

ijimenez@login:~$ module avail ------------------------------------------------------ /soft/lmod/lmod/modulefiles/Core ----------------------------------------------------------------------
   lmod/lmod    python/2.7.5    python/3.3.2   (D)    settarg/settarg    stress/1.0.4    x86_open64/4.5.2.1   Where:
   (D):  Default Module ijimenez@login:~$ module load python/3.3.2
ijimenez@login:~$ python --version
Python 3.3.2

Let's change the python version:

ijimenez@login:~$ module load python/2.7.5 ijimenez@login:~$ python --version
Python 2.7.5