I have a bash script that I have added as a startup application. It does a bunch of exports and alias assignment.
#! /bin/bash
alias devhm='cd ${DEV_HOME}; ll';
alias wlhm='cd ${WL_HOME}; ll';
alias dirch='watch --interval=1 "ls -la"';
alias vols='watch --interval=1 "df -h"';
alias svn-update='svn update --depth infinity ./*';
alias mci="~/mci.sh";
alias vncserver="vncserver -geometry 1680x1050";
alias ..="cd ..";
alias hist="history | grep ";
export PROXY_HOST=proxy.my.setup;
export PROXY_PORT=3128;
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH/usr/lib/oracle/12.1/client64/lib;
export ORACLE_HOME=/usr/lib/oracle/12.1/client64;
export TNS_ADMIN=${ORACLE_HOME}/network/admin;
echo "DONE!";
But none of these values are available in my terminal sessions anymore. Even when I run the script straight into the terminal like so:
./setup.sh
I see the "DONE!" prompt printed but no aliases or env variables are set.
If I copy and paste the contents of the file into the terminal the aliases and env variables are set.
I have tried adding a line to execute the script from .bashrc
also but still no aliases or env variables set.
Any ideas what might be going on here? Also could anyone suggest a better way to have these env variables/aliases added to every terminal session?
In your
.bashrc
reference your custom startup script using. setup.sh
instead of./setup.sh
. That will cause it to be executed in the context of the current session instead of being executed as a separate program with its own context.