Re: interactive shell detection in shrc

RVP <[email protected]>
Newsgroups gmane.os.netbsd.devel.userlevel
Message-ID <[email protected]>
On Mon, 30 Sep 2024, [email protected] 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.