|
[Sponsors] |
July 30, 2012, 04:29 |
Setting environment variables: bash issue
|
#1 |
New Member
av
Join Date: Feb 2012
Posts: 5
Rep Power: 14 |
Hello,
I would like to automate environment initialization prior to OpenFOAM use. I wrote the following bash script, but it doesn't work at all. Environment is only set inside script, when it exit the script and goes back to console, nothing changes, no variable has been defined. #!/bin/bash source /opt/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc source $HOME/.bashrc cd $FOAM_RUN Do you know how can I keep environment after script execution ? Thanks for your help. Xavier |
|
July 30, 2012, 17:12 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings Xavier and welcome to the forum!
You should resort to an alias instead, placed in your "~/.bashrc". Example for your case: Code:
alias of211combo='source /opt/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc; cd $FOAM_RUN' Best regards, Bruno
__________________
|
|
July 31, 2012, 03:17 |
|
#3 |
New Member
av
Join Date: Feb 2012
Posts: 5
Rep Power: 14 |
Great !
Thank you very much for your advice and for the link. sincerely, Xavier |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Windows Environment variables- to solve problems in compiling UDF in Fluent | Modest Cat | Fluent UDF and Scheme Programming | 39 | May 18, 2016 10:33 |
Issue with tcsh vs bash shells | Gary_cfd | OpenFOAM Installation | 1 | June 21, 2012 17:06 |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 18:56 |
Setting up Enviromental Variables | hasan_hzl | ANSYS | 0 | December 5, 2009 04:46 |
FloWorks (Flow Express) Volume Goal Setting Issue | rbigelow | FloEFD, FloWorks & FloTHERM | 1 | November 16, 2009 01:32 |