Scripts assume bash is /bin/bash

Issue #295 resolved
Paul Hargrove created an issue

We have #!/bin/bash hard coded in several scripts.
While that is completely safe on our current target systems, it is not always true.
In particular, I am concerned that Apple's change (in Catalina) to /bin/zsh as the default shell could be part of a longer term plan to cease distributing bash at all (as has already been hinted at for perl).

#!/usr/bin/env bash might work if we assume /usr/bin/env is sufficiently universal.

Substitution is possible at install time, with some care.
This could be done with a probe in configure once PR134 has introduced one.
Of course that means the configure script itself might need a "bootstrap" to find bash for its own use!
For that I think --with-bash=... would be good enough.

Comments (2)

  1. Paul Hargrove reporter

    Support bash in locations other than /bin

    This commit makes all the necessary changes to allow compilation of UPC++ on a FreeBSD system with bash located /usr/local/bin/bash. This includes having configure search $PATH for a shell to run itself with, substitution into generated in-build-tree scripts, setting of SHELL in makefiles, and rewriting of the she-bang when installing upcxx.sh.

    Resolves issue #295

    → <<cset 03a52d5c4e5e>>

  2. Log in to comment