CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Installation

Source or executre startup file for OpenFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Display Modes
Old   November 1, 2015, 12:43
Default Source or executre startup file for OpenFOAM
  #1
Member
 
Thomas Oliveira
Join Date: Apr 2015
Posts: 73
Rep Power: 3
t.oliveira is on a distinguished road
The installation instructions on http://www.openfoam.org/download/ubuntu.php tell the user to add the following line at the bottom of ~/.bashrc:
Code:
source /opt/openfoam240/etc/bashrc
However, the after installing openfoam240 via apt-get install, the user is instructed to add the following line instead:
Code:
.  /opt/openfoam240/etc/bashrc
Apparently, there is a difference between executing and sourcing a bash script (http://superuser.com/questions/17678...g-a-bash-scrip).
Do both alternatives work the same?
t.oliveira is offline   Reply With Quote

Old   November 1, 2015, 13:45
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,409
Rep Power: 25
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

Yes, there is difference between sourcing and executing but

Code:
. /opt/openfoam240/etc/bashrc
is not execution of the script. This is an excerpt from man bash:

Code:
        .  filename [arguments]
       source filename [arguments]
              Read and execute commands from filename in the current shell environment and return the exit  status  of
              the  last  command executed from filename. ...
In fact the same said in the last paragraph of Terminology section on the page you have mentioned in your post.
wyldckat likes this.
alexeym is offline   Reply With Quote

Old   November 2, 2015, 06:21
Default
  #3
Member
 
Thomas Oliveira
Join Date: Apr 2015
Posts: 73
Rep Power: 3
t.oliveira is on a distinguished road
Thank you, alexeym!
And sorry, a more attentive reading would have been enough.
t.oliveira is offline   Reply With Quote

Reply

Tags
bashrc, execute, source, startup

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Pre-Processing 24 August 23, 2015 22:41
Adding solvers from DensityBasedTurbo to foam-extend 3.0 Seroga OpenFOAM Installation 9 June 12, 2015 17:18
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
Swak4Foam funkyDoCalc with OF2.3 massflow NiFl OpenFOAM 8 March 24, 2014 21:06
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 12:44


All times are GMT -4. The time now is 04:58.