Re: Shell scripts, fglgo & interrupt
Posted in 1995
I use the following trival piece of C code to do the job, in conjunction with the script: trap "" 2 3 while : do iqon fglgo test done Note that the C code should really include <unistd.h> to pick up the declaration of execvp(), and <stdlib.h> for exit(), and it should use EXIT_FAILURE in place of 1 in the call to exit(). Equally, I haven't changed it in a while, as you can also see from the last changed date... Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >Date: Mon, 24 Jul 1995 09:36:16 +0100 (BST) >From: "Juan M. DeVilleros" <ejda142@delta.eafit.edu.co> >X-Informix-List-Id: <list.7006> > >Hi, Informixer's. > >A simple shell like > > while : > do > fglgo test > done > >aborts if I use the Interrupt key inside the 4gl program. Does anybody >how to avoid this? I canot use trap "" 2 because I need the interrupt >signal in the program. any ideas? /* @(#)File: iqon.c @(#)Version: 1.1 @(#)Last changed: 89/09/07 @(#)Purpose: Ensure interrupt and quit are enabled @(#)Author: J Leffler */ #include <signal.h> #ifndef lint static char sccs[] = "@(#)iqon.c 1.1 89/09/07"; #endif main(argc, argv) int argc; char **argv; { signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_DFL); execvp(argv[1], &argv[1]); exit(1); }