简体   繁体   中英

RHEL - Environment variable

I have an environment file named .env337_dev . I need to run this file to set the environment before running another command. How to run this file?

Inside the file, it contains several variables like this

export AB_HOME=/et/dev/abinitio/sit1/abinitio-V2   #/gcc3p32   # for 32-bit
export PATH=${AB_HOME}/bin:${PATH}

Apart from . ./.env337_dev . ./.env337_dev command which will run and set the environment, is there any other way to run this file ?

Are you looking for the user-specific .bashrc ( bash is the default shell on RHEL 6) or a system-wide /etc/profile.d/<something>.sh ? For the first, you would edit $HOME/.bashrc and append a line like . .env337_dev . .env337_dev (it's still run before any "regular" command, because .bashrc is the Bash standard personal initialization file). Second option suggests that you use an absolute path.

If this doesn't answer your question, a more specific question and/or more details would be very helpful.

You tagged this ab-initio, so you should only be setting a very few environment variables, including:

export AB_HOME=<path-to-co>operating-system>
export PATH=$AB_HOME/bin:$PATH

If you are working with Ab Initio web applications:

export AB_APPLICATION_HUB=<path-to-application-hub>
export JAVA_HOME=<path-to-jdk>
export PATH=$JAVA_HOME/bin:$PATH

and specific settings for different applications, eg

export AB_MHUB_HOME=<path-to-metadata-hub-installation>

Typically you put those into the file .profile in your home directory, which shells evaluate for interactive sessions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM