shellspec
shellspec copied to clipboard
yash version 2.54 does not work with shellspec
The following happens if using shellspec with the latest version 2.54 of yash in a mostly empty directory:
$ yash --version
Yet another shell, version 2.54
Copyright (C) 2007-2023 magicant
This is free software licensed under GNU GPL version 2.
You can modify and redistribute it, but there is NO WARRANTY.
$ shellspec --version
0.28.1
$ tree -a
.
├── .shellspec
└── spec
1 directory, 1 file
$ shellspec -s yash
/nix/store/bys23is0nv3bpg1cira5k46qhm5bbfqa-yash-2.54/bin/yash: no such command `['
/nix/store/bys23is0nv3bpg1cira5k46qhm5bbfqa-yash-2.54/bin/yash: no such command `['
/nix/store/bys23is0nv3bpg1cira5k46qhm5bbfqa-yash-2.54/bin/yash: no such command `echo'
Shell inspection failed. This shell is not supported.
(It is not a POSIX shell or basic functionality is defective).
Outside of shellspec these commands are available though:
$ yash --norcfile
$ echo test
test
$ [ -n "" ]
$ echo $?
1
I assume this is due to the following change (taken from the changelog of yash):
= The shell now requires a corresponding external executable to
exist in $PATH when running a built-in that works like a standard
external utility even when the POSIXly-correct mode is inactive.
Such built-ins are now categorized as "substitutive" built-ins.
Apparently, the checks for [ and echo happen in an environment in which these commands are not available on the PATH, which leads to yash's built-ins of them being unavailable as well. yash's behavior in this case is POSIX-compliant, according to a short web search.