Sponsored Content
Top Forums Shell Programming and Scripting Intercepting SIGINT in a bash script Post 302330571 by jim mcnamara on Wednesday 1st of July 2009 04:30:49 PM
Old 07-01-2009
Code:
trap "some command goes here" 0

executes on shell script exit
 

10 More Discussions You Might Find Interesting

1. AIX

AIX intercepting system calls

hi, How to intercept existing system calls by kernel extensions on AIX? (2 Replies)
Discussion started by: ramkumar.pvs
2 Replies

2. Programming

Problem with handling SIGINT

For a program I am designing, which involves handling the keyboard input Ctrl^c (SIGINT), it is taking ages for the program to actually recognise and perform the corresponding action whenever I run it and hit Ctrl^C at the CL. I have to do at least 3 Ctrl^Cs before the program will actually... (3 Replies)
Discussion started by: JamesGoh
3 Replies

3. Programming

[C] fgets problem with SIGINT singlal!!!

Hi all, I have this method to read a string from a STDIN: void readLine(char* inputBuffer){ fgets (inputBuffer, MAX_LINE, stdin); fflush(stdin); /* remove '\n' char from string */ if(strlen(inputBuffer) != 0) inputBuffer = '\0'; } All work fine but if i... (1 Reply)
Discussion started by: hurricane86
1 Replies

4. Programming

why multiple SIGINT raises when i hit C-c

hi, in my application, i have set up to capture SIGINT and execute a handler.the problem is whenever i hit C-c, multiple SIGINT are sent to the application.I have blocked the SIGINT right after catching the first one but it is unsuccessful.Here is what i do : jmp_buf main_loop; int... (1 Reply)
Discussion started by: Sedighzadeh
1 Replies

5. Shell Programming and Scripting

Strange SIGINT propagation between Parent/Child sh scripts

Good day, I am trying to add signal handling capabilities to some of my scripts. Unfortunately, I am having some difficulty with the manner in which signals are propagated between parent/child processes. Consider the following example: I have the following "parent" script: #!/usr/bin/sh... (5 Replies)
Discussion started by: danie.ludick
5 Replies

6. Shell Programming and Scripting

Sh script sends SIGINT to a process

Hello, What I want to accomplish is this: I have made a very simple script that runs 2 commands, polipo proxy and tor. The script runs successfully and the output of tor is visible to the screen. I am using the trap command in order to catch the ctrl+c button combo in order to stop polipo... (5 Replies)
Discussion started by: redsolja
5 Replies

7. Shell Programming and Scripting

Trapping SIGINT after restarting program.

Tried to add a function to my control_c interrupt here. It works but has one little bug. If the user selects to run the function instead of exiting, the program restarts itself without forking as it should. However, after that control_c no longer works again. I wanted to allow the user to run... (1 Reply)
Discussion started by: Azrael
1 Replies

8. UNIX for Dummies Questions & Answers

SIGINT issue

May i know what are the possible causes for SIGINT other than ctrl-c? Thanks (17 Replies)
Discussion started by: pandeesh
17 Replies

9. Shell Programming and Scripting

Always pass SIGINT in ksh

The following command will run and wait for input from the user. /usr/sap/SAP/webdisp/wdispmon pf=/usr/sap/SAP/webdisp/profile What I would like to do is (in one command): - Add the above line to a ksh script - Receive the output - and send a SIGINT I have seen many posts on how to... (3 Replies)
Discussion started by: sapsid
3 Replies

10. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
XSIL2GRAPHICS(1)					User Contributed Perl Documentation					  XSIL2GRAPHICS(1)

NAME
xsil2graphics - generate scripts to load xsil output data files SYNOPSIS
xsil2graphics [options] <xsil_file> DESCRIPTION
Utility program bundled with xmds, used to generate scripts that load simulation output data into either matlab (http://www.mathworks.com) or scilab (http://www.scilab.org), which are then used to manipulate the results further if necessary and then to present the results graphically. Matlab To generate a matlab m-file, from the xsil file data_file.xsil use the command: bash$ xsil2graphics data_file.xsil or bash$ xsil2graphics --matlab data_file.xsil Then at the matlab command prompt: >> data_file Scilab To generate a scilab script file, from the xsil file data_file.xsil use the command: bash$ xsil2graphics --scilab data_file.xsil Then at the scilab command prompt: --> exec('data_file.sci') OPTIONS
-m, --matlab generate matlab m-file script to load data from the xsil data file (the default option) -s, -scilab generate scilab script file to load data from the xsil data file -o, --outfile <out_file> specify an alternative output script filename to the default which is the input xsil filename with the .xsil extension changed to either .m for the matlab m-file or .sci for the scilab script file EXAMPLES
bash$ xsil2graphics nlse.xsil Generates the output nlse.m to load the data into matlab bash$ xsil2graphics -m nlse.xsil Also generates the output nlse.m but explicitly sets matlab to be the output format bash$ xsil2graphics --scilab nlse.xsil Generates the output nlse.sci to load the data into scilab bash$ xsil2graphics --outfile nlse_new.m nlse.xsil Generates the output nlse_new.m to load the data into matlab AUTHORS
Originally written by Greg Collecutt Maintained by Paul Cochrane with code contributed by Joe Hope BUGS
No known bugs. SEE ALSO
xmds(1), loadxsil(1) http://www.xmds.org COPYRIGHT
Copyright (C) 2000-2004 Code contributed by Greg Collecutt, Joseph Hope and Paul Cochrane This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. perl v5.8.2 2004-06-21 XSIL2GRAPHICS(1)
All times are GMT -4. The time now is 01:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy