Visit Our UNIX and Linux User Community


Updating variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Updating variable
# 1  
Old 01-03-2012
Data 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
# 2  
Old 01-03-2012
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:
Code:
#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 Smilie

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
Code:
grep -Rl XCRYSDEN_TOPDIR /home

for example.
This User Gave Thanks to zaxxon For This Post:
# 3  
Old 01-03-2012
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:
Code:
ls -al

see ya
fra
This User Gave Thanks to frappa For This Post:
# 4  
Old 01-03-2012
Ok, After I have found the varible how do I change it to point to the new file?
# 5  
Old 01-03-2012
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.:
Code:
$ source filename

This User Gave Thanks to frappa For This Post:

Previous Thread | Next Thread
Test Your Knowledge in Computers #624
Difficulty: Medium
The continue statement is used in Python to skip the rest of the statements in the current loop block and to continue to the next iteration of the loop.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Help with updating bios

I need to update a setting in the BIOS on our SCO Openserver 5.0.7 system and all I can bring up about it says I need to create a dos bootable disk of some sort. The problem is that it doesn't seem like dos is loading up fully. I created the dos bootable thumb drive on a Windows PC using Rufus... (7 Replies)
Discussion started by: hometrics
7 Replies

2. Shell Programming and Scripting

Updating a variable within a variable

I am trying to increment a counter variable that sits within a seperate text variable. I am initializing the counter variable once only at the start of my code. I expected to be able to increment the counter and have the text variable (that countains the counter) display as incremented throughout... (8 Replies)
Discussion started by: Flip-Flop
8 Replies

3. Ubuntu

16.04 not updating

Just installed the latest version on my hp stream, was tired of windows. Of the few times I've used Linux, this is the first time it won't update. Im connected to the net the updater recognizes that the OS needs 21 updates. But it won't download/install the updates. It also won't load the... (1 Reply)
Discussion started by: DabblingMadman
1 Replies

4. Shell Programming and Scripting

error while updating rows in sql with values in array variable

Hi, I need to update rows in a table based on the values in an array variable. code is : while read line do error_msg="$(echo $line)" index=`expr $index+1` done <"logs/$ffile" rows_count=${#error_msg } i=0 while do echo "error msgs is... (2 Replies)
Discussion started by: RP09
2 Replies

5. Emergency UNIX and Linux Support

Table is not updating

Hi, I have script lyk: nawk '{{print $1,$2,$3}}' ./$DirectoryName/AuditGroupTableTableData_$TimeStamp.txt | while read a b c do echo $a echo $b echo $c ret=`sqlplus -s $db_user/$db_pwd@$db_sid $a $b $c <<EOF SET HEADING OFF SET SERVEROUTPUT ON SET FEEDBACK OFF DECLARE CNT ... (42 Replies)
Discussion started by: rkrish
42 Replies

6. Shell Programming and Scripting

awk - updating variable in if statement

I have another question I am stuck at :wall: I have a text file with two columns, like so... 2 0.0627279 3 0.0794451 4 0.108705 5 0.137739 6 0.190394 7 0.217407 8 0.241764 9 0.344458 10 0.460762 I'd like to go through the file line by line until the value in the second column... (3 Replies)
Discussion started by: origamisven
3 Replies

7. UNIX for Dummies Questions & Answers

Updating a database

i've got a database setup that references user inputs to see if they are already inputted. What I am wanting to do is allow the user to update the database by typing "update: name" where name is someone already in the database. echo "Enter your name." read NAME location=`find . -name... (2 Replies)
Discussion started by: fufaso
2 Replies

8. Shell Programming and Scripting

awk updating one file with another, comparing, updating

Hello, I read and search through this wonderful forum and tried different approaches but it seems I lack some knowledge and neurones ^^ Here is what I'm trying to achieve : file1: test filea 3495; test fileb 4578; test filec 7689; test filey 9978; test filez 12300; file2: test filea... (11 Replies)
Discussion started by: mecano
11 Replies

9. UNIX for Advanced & Expert Users

AutoSys (updating global variable)

Hello all, I am very new at both AutoSys and VBScript. I have looked at the manual for hours however I just can't figure it out, the following is the problem: NOTE: AutoSys is being used in all Windows environment. But realizing that this is a UNIX forum, please do provide the answer however... (1 Reply)
Discussion started by: mik357
1 Replies

Featured Tech Videos