?
Solved

Auto Logout  from Unix

Posted on 1997-12-03
4
Medium Priority
?
915 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

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 …
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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
Course of the Month8 days, 15 hours left to enroll

764 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