Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Auto Logout  from Unix

Posted on 1997-12-03
4
897 Views
Last Modified: 2012-08-14
In the file .profile, I added:
1. stty ^C (to define Ctrl-C as Interrupt Key)
2. fglgo myprog (to run an Informix program)
3. exit (so that user will automatically logout)
However, everytime this Interrupt Key is hit in my
Informix program, the user doesn't logout anymore.
The user remains on the command line.

How can I solve this?

Thank you very much.

NOTE: my version of UNIX is SCO
0
Comment
Question by:nill
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 2008210
exec fglgo myprog

0
 
LVL 1

Accepted Solution

by:
terrycj earned 100 total points
ID: 2008211
use this:

exec fglgo myprog

the shell will then be replaced by your informix
program. when it exits (via ^C or any other way)
the user will definitely be logged out.

terry.

0
 

Author Comment

by:nill
ID: 2008212
This really works if I run an Informix program directly from
.profile.  However, when I run an Informix program from a UNIX
script file, the program does not go back to the script file
anymore.  I know this is what is going to happen, but I'm just
curious if there is a way to ensure that it will go back to
the script file.

Thanks.
0
 
LVL 1

Expert Comment

by:terrycj
ID: 2008213
it will go back to the script
if you take out the 'exec'.

use the exec when you want the process executing
the script to be simply replaced by your program.
without the exec it (in this case a shell which is
reading and excuting commands) will continue on
to deal with further commands.

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question