Re: interactive shell detection in shrc

Steffen Nurpmeso <[email protected]>
Newsgroups gmane.os.netbsd.devel.userlevel
Message-ID <20240927224352.XbfXbbOA@steffen%sdaoden.eu>
Robert Elz wrote in
 <[email protected]>:
 ...
 || I guess to be entirely POSIX compatible my test should include:
 ||
 ||  tty >/dev/null 2>&1 && tty <&1 >/dev/null 2>&1 &&
 |
 |The second of those would need to be testing (the pre-redirected)
 |stderr, not stdout, interactive shells don't care where stdout has
 |been sent (though the user probably does).
 |
 |But as Steffen (kind of) indicated, "test -t 0 && test -t 2" is
 |probably an easier way than using tty.

(Tiger Lillies, Flying Robert:
  https://www.youtube.com/watch?v=4tPGbHI2GtE)

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
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.