NOAA-PMEL / PyFerret

The PyFerret program and Python module from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
60 stars 22 forks source link

pyferret-deactivate.sh: avoiding bashism in sh scripts #75

Open ryofurue opened 4 years ago

ryofurue commented 4 years ago

envs/FERRET/etc/conda/deactivate.d/pyferret-deactivate.sh includes this line

if [[ -n "$_CONDA_SET_FERRET" ]]; then

which doesn't run on the normal Bourne shell because [[ is not supported by the Bourne shell.

This results in error in the following situation

#!/bin/sh
# . . .
. $CONDABASE/bin/activate FERRET

on a system where /bin/sh is not bash, such as Debian and Ubuntu.

I think the above if statement is equivalent to the more compatible

if [ -n "$_CONDA_SET_FERRET" ]; then

(I know nothing about anaconda, but does the system distinguish "sh" and "bash". I hope so.)

Cheers, Ryo