This is my first post. I wanted to ask for any idea so to solve my problem. I am using Ubuntu 12.04 LTS, and my purpose is to use OpenFoam CFD software.
I am trying to execute an script called Allrun that corresponds to a tutorial. I am using the sudo command like this.
sudo ./Allrun
then it asks for my password and after introducing it, it suddenly appears a message saying:
./Allrun: 5: .: Can't open /bin/tools/RunFunctions
This path appeares at line 5 as sourced in the script, so like:
. $WM_PROJECT_DIR/bin/tools/RunFunctions
being $WM_PROJECT_DIR a variable defined in opt/openfoam22/etc/bashrc and pointing the directory:
$WM_PROJECT_DIR= /opt/openfoam222
(this bashrc is at the same time sourced in ~/.bashrc file, and I can use the variable in the terminal, so I assume it is allright sourced)
I have tried also to chmod the RunFunctions file with rwx permissions, and veryfied with "ls -la" that its permissions changed (they did), but didn't solve anything.
I am new in linux, and any help will be great, thanks in advance.
Now what I see is that the script fails because the source has not been 'loaded'.
My ~/.profile sources my ~/.bashrc, which sources the /opt/openfoam222/etc/bashrc
I find there an odd variable definition such as:
foamInstall=/opt
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR
(note the ":
" before the $) and few lines further...export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/openfoam222
Any idea to source all this properly?
– Danubi Nov 22 '13 at 12:18.profile
came from ubuntu12.04 written by default (I haven't touched it). It sources my ~/.bashrc by the following:# if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi
Furthermore I found in the OpenFoam 'Installation Guide' (http://www.openfoam.org/download/ubuntu.php) the step that asks for sourcing the /opt/openfoam222/etc/bashrc within the ~/.bashrc file. I have tried different tutorials and I get the same error everywhere. – Danubi Nov 24 '13 at 19:35