Summary
Using gvm use in an interactive shell floods the terminal with:
gvm_pseudohash_encode:25: command not found: -e
(in bash the same defect surfaces as -e: command not found, and for other helpers as -1: command not found, -v: command not found, etc.)
Root cause
scripts/function/tools defines LS_PATH, TR_PATH, SED_PATH, GREP_PATH, EGREP_PATH, SORT_PATH, HEAD_PATH and HEXDUMP_PATH. It is loaded only by scripts/functions, which iterates scripts/function/*.
scripts/env/use and scripts/env/pkgset-use never source scripts/functions — they only source _bash_pseudo_hash and _shell_compat:
https://github.com/moovweb/gvm/blob/master/scripts/env/use#L1-L4
So every tool variable is empty on those code paths, and each command loses its argv[0]:
scripts/function/_bash_pseudo_hash:289 — echo -n "$__char" | $HEXDUMP_PATH -e '1 1 "!%02x"' runs -e as the command
scripts/env/use:201, scripts/env/pkgset-use:191,223,224 — $LS_PATH -1 ... | $SORT_PATH | $GREP_PATH ... | $HEAD_PATH -n 1
scripts/function/gvm_export_path:3 — $TR_PATH, $GREP_PATH, $EGREP_PATH, $SED_PATH
scripts/function/gvm_environment_sanitize:7 — $SED_PATH
zsh reports the error at the enclosing case statement (line 25 of the function), which is why the message points at a line with no command in it.
Second, related bug
scripts/templates/binary:2 sources a path that does not exist:
. "$GVM_ROOT/scripts/functions/tools"
The directory is scripts/function (singular); scripts/functions is a file. Generated binary wrappers therefore always run with an empty $GREP_PATH on line 3.
Reproduce
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
source ~/.gvm/scripts/gvm
gvm install go1.21.0 -B
gvm use go1.21.0
Environment: macOS 15 (Darwin 25.6.0), arm64, zsh 5.9 and bash 3.2/5.x, gvm 1.0.22.
Fix
Source scripts/functions from scripts/env/use and scripts/env/pkgset-use, correct the scripts/functions/tools path in scripts/templates/binary, and add ${VAR:-tool} fallbacks in the _-prefixed files that are documented as standalone-sourceable.
Happy to open a PR with this.
Summary
Using
gvm usein an interactive shell floods the terminal with:(in bash the same defect surfaces as
-e: command not found, and for other helpers as-1: command not found,-v: command not found, etc.)Root cause
scripts/function/toolsdefinesLS_PATH,TR_PATH,SED_PATH,GREP_PATH,EGREP_PATH,SORT_PATH,HEAD_PATHandHEXDUMP_PATH. It is loaded only byscripts/functions, which iteratesscripts/function/*.scripts/env/useandscripts/env/pkgset-usenever sourcescripts/functions— they only source_bash_pseudo_hashand_shell_compat:https://github.com/moovweb/gvm/blob/master/scripts/env/use#L1-L4
So every tool variable is empty on those code paths, and each command loses its argv[0]:
scripts/function/_bash_pseudo_hash:289—echo -n "$__char" | $HEXDUMP_PATH -e '1 1 "!%02x"'runs-eas the commandscripts/env/use:201,scripts/env/pkgset-use:191,223,224—$LS_PATH -1 ... | $SORT_PATH | $GREP_PATH ... | $HEAD_PATH -n 1scripts/function/gvm_export_path:3—$TR_PATH,$GREP_PATH,$EGREP_PATH,$SED_PATHscripts/function/gvm_environment_sanitize:7—$SED_PATHzsh reports the error at the enclosing
casestatement (line 25 of the function), which is why the message points at a line with no command in it.Second, related bug
scripts/templates/binary:2sources a path that does not exist:The directory is
scripts/function(singular);scripts/functionsis a file. Generated binary wrappers therefore always run with an empty$GREP_PATHon line 3.Reproduce
Environment: macOS 15 (Darwin 25.6.0), arm64, zsh 5.9 and bash 3.2/5.x, gvm 1.0.22.
Fix
Source
scripts/functionsfromscripts/env/useandscripts/env/pkgset-use, correct thescripts/functions/toolspath inscripts/templates/binary, and add${VAR:-tool}fallbacks in the_-prefixed files that are documented as standalone-sourceable.Happy to open a PR with this.