On Mon, 30 Sep 2024, tlaronde%kergis.com@localhost wrote:
But, if I'm not mistaken, the discussion was about testing if a shell is interactive, that is, "inheriting" whatever has been set and testing it. Since SHELL is not set by all login programs (your example of xterm) and since the variable, if redefined or undefined, is not set automatically by all shells, it can not be used neitherto identify the shell and nor to use reliably to verify that it is an interactive session.
If you're talking about checking for "interactivity" in arbitrary shells running under arbitrary programs, then I have no clue, Thierry :). But, for POSIX (Bourne) shells, they should set `i' in `$-'. Not sure why one would additionally want to examine $SHELL here. (I've not read all the emails in this thread, so may have missed that part.) -RVP