Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 exptools 1/6/84; site ihuxe.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxj!houxm!ihnp4!ihuxe!chas From: chas@ihuxe.UUCP (Charles Lambert) Newsgroups: net.unix Subject: Test for login shell Message-ID: <1034@ihuxe.UUCP> Date: Tue, 22-Jan-85 18:11:00 EST Article-I.D.: ihuxe.1034 Posted: Tue Jan 22 18:11:00 1985 Date-Received: Thu, 24-Jan-85 05:43:15 EST Organization: AT&T Bell Labs, Naperville, IL Lines: 11 Can anyone suggest a reliable test to determine whether a shell script is executing in the highest-level instance of the shell (by "." invocation) or in a child shell (by normal invocation). I need to write a script which will "exec" a program if it is NOT executing at the log-in level (because the session would disappear on termination of the command). Mail answers to me, I'll post the best solutions later.