This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Use of export command

Hi, community! After reading a lot, I am still not very familiar with the export command. I need to install Busco, and I am stuck in this section:

define a custom path (including the filename) to the config.ini file by setting the following environment variable, which will override the default location:
export BUSCO_CONFIG_FILE="/path/to/filename.ini"
This is useful for switching between configurations or in a multi-users environment. In addition to Python, you will need to make sure that the following required software packages (NCBI + HMMER + AUGUSTUS) are installed with their paths declared in the config.ini file.

Sorry to ask this question here, but the Github repository for Busco doesn't reply to me.
I hope you can help me out.

busco linux

1 answer

Hi caro-ca

export is built-in generic linux command whose details could be found here

In this case export command will update the current shell session with the exported variable; i.e. BUSCO_CONFIG_FILE. So, you have to provide the path of the .ini file to BUSCO_CONFIG_FILE variable using export. And then to check if the path has been set correctly, you can do

echo $BUSCO_CONFIG_FILE

and that should echo the path to the .ini file. I hope this helps.

Thank you for your help! I will try that out!

I notice that when I open another terminal, the echo $BUSCO_CONFIG_FILE doesn't tell me the paths. Do I have to use source ~/.bash_profile ?

exporting has the more specific function of making the exported item (be it a variable or a function) available not only to your shell session, but also any child shells it spawns.

Environment variables (such as your $BUSCO_CONFIG_FILE) persist only within that shell session. When you open a new terminal, it doesn’t know that variable ever existed.

If you need that variable to persist indefinitely, you need to add the command export $MY_VARIABLE to one of the ‘start up’ files. These vary slightly by your OS, but are generally called ‘dotfiles’. These include .profile, .bashrc (if bash is your shell), .bash_profile.

Run the command:

echo 'export BUSCO_CONFIG_FILE="/path/to/file.in"' >> ~/.bash_profile

To add it permanently.

Log in to answer this question.