#!/bin/sh # Select the correct shell configuration file USER_HOME=$HOME PROFILE="$USER_HOME/.bashrc" # default if [ "$(uname)" = "Linux" ]; then # Linux case # Check which sheel the user is using # Trim the $SHELL variable to only have the shell name SHELL_NAME=`echo $SHELL | awk -F/ '{print $NF}'` case "$SHELL_NAME" in "sh" ) PROFILE="$USER_HOME/.profile" ;; "bash" ) PROFILE="$USER_HOME/.bashrc" ;; "zsh" ) PROFILE="$USER_HOME/.zshrc" ;; "csh" ) PROFILE="$USER_HOME/.cshrc" ;; "tcsh" ) PROFILE="$USER_HOME/.tcshrc" ;; "ksh" ) PROFILE="$USER_HOME/.kshrc" ;; esac else # OSX case if [ -f "$USER_HOME/.profile" ]; then PROFILE="$USER_HOME/.profile" else PROFILE="$USER_HOME/.bash_profile" fi fi # Export path echo "Exporting and setting environment variables" echo "Please launch an other shell session or source'd your shell profile file" export EZ_PATH="/usr/local/easea/" export PATH="$PATH:/usr/local/easea/bin" echo >> $PROFILE echo "# EASEA paths for compiler and library">> $PROFILE echo "export EZ_PATH=$EZ_PATH">>$PROFILE echo "export PATH=\$PATH:/usr/local/easea/bin" >>$PROFILE