github.com/singularityware/singularity@v3.1.1+incompatible/etc/actions/shell (about)

     1  #!/bin/sh
     2  
     3  for script in /.singularity.d/env/*.sh; do
     4      if [ -f "$script" ]; then
     5          . "$script"
     6      fi
     7  done
     8  
     9  if test -n "$SINGULARITY_SHELL" -a -x "$SINGULARITY_SHELL"; then
    10      exec $SINGULARITY_SHELL "$@"
    11  
    12      echo "ERROR: Failed running shell as defined by '\$SINGULARITY_SHELL'" 1>&2
    13      exit 1
    14  
    15  elif test -x /bin/bash; then
    16      SHELL=/bin/bash
    17      PS1="Singularity $SINGULARITY_NAME:\\w> "
    18      export SHELL PS1
    19      exec /bin/bash --norc "$@"
    20  elif test -x /bin/sh; then
    21      SHELL=/bin/sh
    22      export SHELL
    23      exec /bin/sh "$@"
    24  else
    25      echo "ERROR: /bin/sh does not exist in container" 1>&2
    26  fi
    27  exit 1