URL: <https://savannah.gnu.org/bugs/?68212>
Summary: shell scripts should not use `"$SHELL" -c` to test
shell features
Group: GNU roff
Submitter: gbranden
Submitted: Sat 04 Apr 2026 01:43:45 AM UTC
Category: General
Severity: 3 - Normal
Item Group: Incorrect behaviour
Status: In Progress
Privacy: Public
Assigned to: gbranden
Open/Closed: Open
Discussion Lock: Unlocked
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Sat 04 Apr 2026 01:43:45 AM UTC By: G. Branden Robinson <gbranden>
Affects nroff, neqn, eqn2graph, grap2graph, and pic2graph.
[https://lists.gnu.org/archive/html/groff/2026-04/msg00001.html Johannes
Altmanninger reported this issue to the _groff_ list.]
> $SHELL is the user's login shell. It may change on every login.
> It's often a POSIX shell but not always and there's no need to
> require that, given that we never need to spawn the user's preferred
> interactive shell.
>
> For executing shell scripts, we use POSIX_SHELL_PROG. This is
> determined at compile time, usually as /bin/sh.
>
> Commit c34c6cc58 ([nroff]: Improve shell behavior check., 2024-12-07)
> used $SHELL to work around an issue caused by a POSIX non-> compliant
> POSIX_SHELL_PROG=/bin/sh on Solaris 10.
>
> We care about the currently executing shell, so use a POSIX subshell
> instead of "$SHELL -c" to test exactly that, even if the user has
> changed their login shell or overridden $SHELL.
>
> Originally reported at https://github.com/fish-shell/fish-shell/issues/12602
I concur. Sorry for the trouble. I don't often think about the _fish_ shell,
but if I had migrated myself to the _rc_ shell as I've threatened to do, I
might have caught this issue myself.
Thanks for the report.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68212>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
