Skip to content
Snippets Groups Projects
Commit 9ceec7e2 authored by Massimiliano Culpo's avatar Massimiliano Culpo Committed by Todd Gamblin
Browse files

Harden shell detection when procfs is available (#13950)

parent e366d5b5
No related branches found
No related tags found
No related merge requests found
......@@ -215,11 +215,14 @@ _spack_pathadd() {
}
#
# Determine which shell is being used
#
_spack_determine_shell() {
if [ -n "${BASH:-}" ]; then
if [ -f "/proc/$$/exe" ]; then
# If procfs is present this seems a more reliable
# way to detect the current shell
_sp_exe=$(readlink /proc/$$/exe)
basename ${_sp_exe}
elif [ -n "${BASH:-}" ]; then
echo bash
elif [ -n "${ZSH_NAME:-}" ]; then
echo zsh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment