Bourne Again Shell (bash)

Macintosh

On your own Mac (assuming that you are called $USER on other servers), copy below into $HOME/.bash_profile:

DAMASK=$HOME/Documents/DAMASK
NETID=$USER               # make sure that the NetID is correct
alias ls='ls -Gh'
alias ll='ls -lGh'
alias la='ls -alGh'
alias lsd='ls -rtlGh'
alias paraview='open /Applications/paraview.app'
alias damask='cd $DAMASK'

brewit () {
brew update
brew upgrade --all
brew cleanup
brew doctor
}

brewstate () {
for item in $(brew list)
do
file=$(brew info $item \
| grep -E '/usr/local/Cellar.*\)( \*)?$' \
| awk {'print $1'})
echo $item ${file#/usr/local/Cellar/$item/}
done
}
decs () {
 [[ "$1" == "" ]] \
 && ssh -X $NETID@scully.egr.msu.edu \
 || ssh -X $NETID@$1.egr.msu.edu
}

hpcc () {
 ssh -X $NETID@hpcc.msu.edu
}

hpccupload () {
 scp -r ${@:0:$#} $NETID@hpcc.msu.edu:${@: -1}
}

hpccdownload () {
 scp -r $NETID@hpcc.msu.edu:${@:0:$#} ${@: -1}
}
cmm () {
 ssh -Y $USER@cmm.dhcp.egr.msu.edu
}

export GRI=$HOME/Documents/gri-plotting
export PATH=$GRI:$PATH
export PETSC_DIR=$(brew info petsc | grep PETSC_DIR | awk '{print $4}')

[[ -e $DAMASK/DAMASK_env.sh ]] \
&& source $DAMASK/DAMASK_env.sh

DECS compute cluster

On the DECS compute servers, copy below into $HOME/.bash_profile:

if [ `hostname -s` = scully ]; then
  if [ -e /egr/research/CMM/updateDECS/computeuse.pl ]; then
    /egr/research/CMM/updateDECS/computeuse.pl
    alias computeuse='/egr/research/CMM/updateDECS/computeuse.pl'
    alias ssh='ssh -Y'
  fi
else
  [[ -f /egr/research/CMM/.bashrc ]] \
  && source /egr/research/CMM/.bashrc
fi

HPCC

On the High Performance Computing Center (HPCC), copy below into $HOME/.bashrc:

test -f /etc/profile.dos && . /etc/profile.dos

# Some applications read the EDITOR variable to determine your favourite text
# editor. So uncomment the line below and enter the editor of your choice :-)
#export EDITOR=/usr/bin/vim
#export EDITOR=/usr/bin/mcedit

for resource in \
 /mnt/research/CMM/.bashrc \
 $HOME/.environment \
 $HOME/.alias \
 $HOME/.modules \

do
 [[ -s $resource ]] && . $resource
done
 
for environment in \
  /mnt/research/CMM/DAMASK/$USER/DAMASK_env.sh \

do
 [[ -e $environment ]] && . $environment
done

One thought on “Bourne Again Shell (bash)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s