LINUX/standalone blast question

Dyre Tjeldvoll dyret at idi.ntnu.no
Wed Nov 3 06:56:17 EST 1999


a.walden at wave.co.nz (Adrian Walden) writes:
[snip]
> 
> My question concerns a few problems I have had with blast and the
> requirement to setup a file called .ncbirc in my root directory or the
> directory from which I call the BLAST application. The contents of the
> .ncbirc file are supposed to be
> 
> [ ncbi]
> Data=/path/blast/data
> 
> I would like to know what this file does and why it is there. 

Many programs have a .programrc file, and I think (!) the rc stands
for resource, and these files are typically for saving settings. 

> Is it supposed to export the variable "Data" to the environment. If
> so, why is it that when I query th environment with
> 
> echo $Data
> 
> that I get a blank line instead of a path to the directory "data" ?

The line in your file sets the local shell-variable Data, not an
environment variable, if the file is treated as a shell-script. 

The difference is that a local variable is only known to shell in
which you set it, whereas an environment variable is inherited to the
processes started by the shell. You can test this by doing the
following:

dyret at vier~$ DUMMY=value
dyret at vier~$ bash
dyret at vier~$ echo $DUMMY

dyret at vier~$ exit
dyret at vier~$ echo $DUMMY
value
dyret at vier~$ export DUMMY=newvalue
dyret at vier~$ echo $DUMMY
newvalue
dyret at vier~$ bash
dyret at vier~$ echo $DUMMY
newvalue

It could of course be that the program itself exports the variable
after having read the file.


The conventional way to make an environment variable is to: 

1) Export the variable using the export command, i.e. 
   export Data=/path/blast/data

or

2) Declare the variable to be an environment variable:
	declare -x Data=/path/blast/data

Either is typically done in your .bashrc, .bash_profile (or .profile)

The bash man page, or alternatively the emacs info page, has more
info.

My advice is that you export Data on the command line (export
Data=/path/blast/data) and then run your program. If it works you
put the export command to your startup file, if not... well, then you
have a different problem. HTH.

-- 
dt





More information about the Bio-soft mailing list