Xref: utzoo comp.unix.questions:5843 comp.unix.wizards:6721 Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!ucbvax!pasteur!ames!hao!oddjob!gargoyle!ihnp4!homxb!mtuxo!mtgzy!mtgzz!avr From: avr@mtgzz.UUCP (XMRP50000[jcm]-a.v.reed) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: execution environment (checking if in .profile) Message-ID: <3668@mtgzz.UUCP> Date: 26 Feb 88 17:17:21 GMT References: <7162@tut.cis.ohio-state.edu> Distribution: na Organization: AT&T, Middletown NJ Lines: 17 Keywords: sh,exec Summary: Sometimes, it can be done In article <7162@tut.cis.ohio-state.edu>, lvc@tut.cis.ohio-state.edu (Lawrence V. Cipriani) writes: > Is there a way for a program to tell if it was executed > 1) via a users .profile or 2) by a user on their command line? > Yes its a strange question, but can it be done? Thanks, It depends on the login shell. For example, ksh sets TMOUT to the system-defined value (often 7200) when it leaves .profile. Thus, if your user's login shell is ksh, put in /etc/profile the lines TMOUT=0 # or any value different from the system-defined value export TMOUT # so your program can examine it readonly TMOUT # so the user can't change it at the start of .profile and then have the program check the value of TMOUT in env. Adam Reed (mtgzz!avr)