Path: utzoo!mnetor!uunet!mcvax!dutrun!dutesta!pjb From: pjb@dutesta.UUCP (P.J. Brand) Newsgroups: comp.unix.questions Subject: Re: Using 'exit' in a Bourne shell script Message-ID: <1074@dutesta.UUCP> Date: 1 Feb 88 15:52:20 GMT References: <169@mccc.UUCP> Organization: Delft University of Technology, Netherlands Lines: 36 From article <169@mccc.UUCP>, by pjh@mccc.UUCP (Peter J. Holsberg): > I would like to have my users logout via a shell script "off" rather > than with ^d. The script I wrote is very simple, but 'exit' has no > effect. > > echo "OFF \c:" >> /usr/.logins > who am i >> /usr/.logins > exit > > The correct entries appear in /usr/.logins, but 'exit' seems to be > ignored. Typing 'exit' at the prompt does in fact do what I want -- > i.e., act as a substitute for ^d. I see that exit(2) is a system call > that terminates the calling process. Oh oh! It terminates 'off' but > doesn't log the user off! Rats!@!@#$% > > Can anyone suggest a way (SysVr3.0) to do what I want? Thanks. > . > > -- The script would work if your users would call: . /usr/local/off or wherever your script is stored. But, instead, you would probably prefer to use: kill -9 0 instead of the exit, to make the script work as expected. ============================================================================== Paul Brand Delft University of Technology INTERNET : karel@dutesta.UUCP Faculty of Electrical Engineering UUCP : ..!mcvax!dutrun!dutesta!karel