Skip to content

profile.sh shell detection does not function properly #173

@jasontibbitts

Description

@jasontibbitts

init/profile.sh will do the following:

shell=$(/usr/bin/basename $(/usr/bin/ps -p $$ -ocomm=))

But for a script, that gives you the name of the script, not the name of the shell. So if I put this in "abc"

#!/bin/zsh
echo foo

and run it, profile.sh will get "abc" in $shell, and so will just fall back to running the sh init code. Which until more recent versions of environment-modules was no big problem because init/sh was pretty simple. Now it's rather complex and it's quite important that the zsh code be run when under zsh.

The end result of this is that every zsh script I run on a machine with environment-modules installed will split out the following to stderr:

/usr/share/Modules/init/sh:36: no such file or directory: eval LD_LIBRARY_PATH='' /usr/bin/tclsh

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions