First of all a bit of background. I apologise in advance for the misuse of terminology. Please correct me where necessary.
For my work I am going to be running simulations remotely via ssh on several ubuntu machines. These machines are in a network and my account is linked across all of them, ie. $HOME
is /home/links/Ogaday
and is mirrored across each machine. So I make a directory on one machine in that folder, and it appears in another machine (this is a case where I don't know how to use the correct terms). There is also local memory on each machine, accessible by each user on that machine, called /scratch/
. I will make a directory in /scratch/
to do my actual work in, because I don't think I have enough memory on my account to run the simulations in $HOME, and it will be faster because it's all local, I assume.
Now, there is software installed on those machines that I need to use, and it is installed in directories that I have no write access to (/usr/local/software/
). However, that software has a bash script that sets environment variables. I'm supposed to append the bash script (source /usr/local/software/etc/bashrc
) to $HOME/.bashrc
in order to set the necessary environment variables. Pretty standard so far, this sets everything up for this software to run when I log in, correct? Now, I think that the software on these computers hasn't been configured properly, because the .../etc/bashrc
is supposed to set a variable called $SOFTWARE_INST_DIR
, the install directory. By default, this is $HOME/software
, and it is necessary to change that bashrc file so that it instead sets it to /usr/local/software
. Of course, I don't have write access to to .../etc/bashrc
. There are other similar issues, this is just the thing that fails first.
As a fix, I copied that file into $HOME/software-etc/bashrc
and appended source $HOME/software-etc/bashrc
to $HOME/.bashrc
instead of appending source /usr/local/software/etc/bashrc
, so that I can edit the variables it assigns. Is there anything fundamentally wrong with this? I thought another solution would be to, instead of copying the bashrc file from the software install location, appending export $HOME=/scratch/ogaday
to .bashrc, which I assume would reassign my home directory to scratch. Am I correct? Is this dangerous? I wouldn't really be using these machines for anything else except running long simulations on them.
ps: The final solution would be to ask the IT guys to look into it I guess! I'd rather do a quick fix though if it's possible.
HOME=/scratch/ogaday
. Noexport
and no$
when assigning variables. – Byte Commander Oct 02 '15 at 11:20