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

[OpenFOAM.org] 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 Search this Thread Display Modes
Old   November 1, 2015, 11:43
Default Source or executre startup file for OpenFOAM
  #1
Senior Member
 
Thomas Oliveira
Join Date: Apr 2015
Posts: 114
Rep Power: 8
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, 12:45
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,922
Rep Power: 34
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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, 05:21
Default
  #3
Senior Member
 
Thomas Oliveira
Join Date: Apr 2015
Posts: 114
Rep Power: 8
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] Installation Problem with OF 6 version Aurel OpenFOAM Community Contributions 9 November 30, 2018 10:20
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 03:04
Problem compiling a custom Lagrangian library brbbhatti OpenFOAM Programming & Development 2 July 7, 2014 11:32
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57


All times are GMT -4. The time now is 12:40.