View Issue Details

IDProjectCategoryView StatusLast Update
0002490OpenFOAMPatchpublic2019-07-16 14:42
Reporterzhou13 Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSOtherOS Version(please specify)
Fixed in Versiondev 
Summary0002490: make etc/bashrc zsh friendly
DescriptionIn zsh, variable $BASH_SOURCE does not exist. This patch fixes this problem by falling back to $0 if BASH_SOURCE does not exist.

diff --git a/etc/bashrc b/etc/bashrc
index 0e88166e7..87e5606f2 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -42,8 +42,8 @@ export WM_PROJECT_VERSION=dev
 #
 # Please set to the appropriate path if the default is not correct.
 #
-[ $BASH_SOURCE ] && \
-export FOAM_INST_DIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) || \
+[ ${BASH_SOURCE:-$0} ] && \
+export FOAM_INST_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../.. && pwd -P) || \
 export FOAM_INST_DIR=$HOME/$WM_PROJECT
 # export FOAM_INST_DIR=~$WM_PROJECT
 # export FOAM_INST_DIR=/opt/$WM_PROJECT



TagsNo tags attached.

Relationships

related to 0003303 resolvedhenry Compilation of (Intel) MPI fails 

Activities

zhou13

2017-03-09 02:02

reporter  

openfoam-zsh.patch (550 bytes)   
diff --git a/etc/bashrc b/etc/bashrc
index 0e88166e7..87e5606f2 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -42,8 +42,8 @@ export WM_PROJECT_VERSION=dev
 #
 # Please set to the appropriate path if the default is not correct.
 #
-[ $BASH_SOURCE ] && \
-export FOAM_INST_DIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) || \
+[ ${BASH_SOURCE:-$0} ] && \
+export FOAM_INST_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../.. && pwd -P) || \
 export FOAM_INST_DIR=$HOME/$WM_PROJECT
 # export FOAM_INST_DIR=~$WM_PROJECT
 # export FOAM_INST_DIR=/opt/$WM_PROJECT
openfoam-zsh.patch (550 bytes)   

henry

2017-03-13 19:49

manager   ~0007925

Resolved by commit 047460b0532160794a5cdfa54ba75766485b3a4f

Issue History

Date Modified Username Field Change
2017-03-09 02:02 zhou13 New Issue
2017-03-09 02:02 zhou13 File Added: openfoam-zsh.patch
2017-03-13 19:49 henry Assigned To => henry
2017-03-13 19:49 henry Status new => resolved
2017-03-13 19:49 henry Resolution open => fixed
2017-03-13 19:49 henry Fixed in Version => dev
2017-03-13 19:49 henry Note Added: 0007925
2019-07-16 14:42 henry Relationship added related to 0003303