Updating variable

Hi,
I have been attempting to install source code from xcrysden with little to no luck. I have attempted to follow the instructions given on the site but made the mistake on the code I downloaded. This was pointed out to my by the developer and I have since downloaded the proper code. However this is where my new problem comes up. The instructions state:

BEWARE: If an older XCrySDen version is already installed, then you should manually update the XCRYSDEN_TOPDIR variable definition in your profile to point to the new place !!!

When i pull up my env list the topdir is labled as:

XCRYSDEN_TOPDIR=/XCrySDen-1.5.25-bin-shared

and the new source code downloaded is xc-1.5.24-linux-x86-semishared.

I'm a new linux user and not very fimilar with these shell commands. Any help on this issue would be great

Thanks,
Zack

Your environment will be set in some file, which includes the definition of that variable. This can be one or more of the following files:

#most probable:
~/.profile
#depending on the shell you use, one of them:
~/.kshrc
~/.bashrc
#least probable:
/etc/profile
/etc/environment

~ should evaluate to the $HOME of your user like /home/zack for example :wink:

It can also be an entry in one of these, that calls another script which holds those variables. If you have no success finding the definition in those files listed above, you can always try something like

grep -Rl XCRYSDEN_TOPDIR /home

for example.

1 Like

Hi,

check for file .bash_profile or .bashrc in your user home directory: the variable should be set there.

in order to list them use:

ls -al

see ya
fra

1 Like

Ok, After I have found the varible how do I change it to point to the new file?

Hi Zbay,

the program source code documentation should point you out to know where the top directory on filesystem for XCrySDen is installed by default (provided that you didn't specified an alternate location during the installation process).

Once you have found where (that is, in which file) the variable is currently defined, you can edit the file so that the value on the right of the "=" sign points to the above said directory of filesystem.

You can use one text editor of your choice (vi, nano) whichever you are comfortable with.

After editing the file, in order to "activate" the new value for the variable you have two choices:

  1. logout then re-login to the system
    OR
  2. source the file containing the variable new value, i.e.:
$ source filename
1 Like