Bash script not adding variables to session
Posted
by
travega
on Ask Ubuntu
See other posts from Ask Ubuntu
or by travega
Published on 2014-05-28T03:31:33Z
Indexed on
2014/05/28
4:01 UTC
Read the original article
Hit count: 457
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?
© Ask Ubuntu or respective owner