Skip to content

Commit 3499ba2

Browse files
author
Ghoshal
committed
By using zsh one would get the following error:
dirname: missing operand Try 'dirname --help' for more information. basename: missing operand Try 'basename --help' for more information The error occurs because the script uses Bash-specific syntax ($BASH_SOURCE) which is not available in zsh ``` export PIC_PROFILE=$(cd $(dirname ${BASH_SOURCE:-$0}) && pwd)/$(basename ${BASH_SOURCE:-$0}) ``` This checks for $BASH_SOURCE (for Bash) and falls back to $0 (for Zsh)
1 parent 565d661 commit 3499ba2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

etc/picongpu/hemera-hzdr/fwkt_v100_picongpu.profile.example

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Name and Path of this Script ############################### (DO NOT change!)
2-
export PIC_PROFILE=$(cd $(dirname $BASH_SOURCE) && pwd)"/"$(basename $BASH_SOURCE)
3-
2+
export PIC_PROFILE=$(cd $(dirname ${BASH_SOURCE:-$0}) && pwd)/$(basename ${BASH_SOURCE:-$0}) # for compatibility with both zsh and bash
43
# User Information ################################# (edit the following lines)
54
# - automatically add your name and contact to output file meta data
65
# - send me a mail on batch system jobs: NONE, BEGIN, END, FAIL, REQUEUE, ALL,

0 commit comments

Comments
 (0)