Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Auto Logout  from Unix

Posted on 1997-12-03
4
Medium Priority
?
926 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
[X]
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
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 2008210
exec fglgo myprog

0
 
LVL 1

Accepted Solution

by:
terrycj earned 300 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
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.
Suggested Courses

610 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