My bash script expects command line arguments that I parse without any problem. However the script later calls an other script which also accepts positional parameters, but providing parameters is not mandatory.
When my script sources the other script without arguments the other script still tries to parse those arguments that were given to my script in the first place.
I have two solutions, but none of them looks good to me.
With
shift:# now making this script to handle branches: OPTIND=1 while getopts "b:" opt; do case "$opt" in 'b' ) branch=$OPTARG ;; esac shift donePassing empty argument to the second script:
source ${MINICONDA}/bin/activate ""