The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
signal handling question fox_hound_33 High Level Programming 7 05-31-2008 01:53 PM
Signal Handling themezzaman High Level Programming 3 07-12-2006 10:05 PM
Perl alarm signal reggiej Shell Programming and Scripting 2 01-15-2006 04:00 PM
signal handling in shell script Raom UNIX for Advanced & Expert Users 4 12-08-2005 06:55 AM
Handling SIGUSR2 signal diganta UNIX for Advanced & Expert Users 3 11-21-2005 11:18 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-19-2007
obelix obelix is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 2
Thumbs down Signal handling in Perl

Guys,

I'm doing signal handling in Perl. I'm trying to catch ^C signal inside the script.

There two scripts : one shell script and one perl script.

The shell script calls the perl script.

For e.g. shell script a.sh and perl scipt sig.pl.

Shell script a.sh looks something like this :

#!/usr/bin/sh

# some code

sig.pl # Call perl script.

# some more code.

Perl script sig.pl looks something like this :

#!/usr/bin/perl

#some code

#signal handling

$SIG{'INT'} = 'Handler';

sub Handler {
print "Caught ^C \n";
exit (0);
}

# Some more code.

The point is : The signal gets caught in sig.pl, but it doesn't return to
a.sh, but instead returns to the command prompt.

I need to do more processing in shell script a.sh.

I've used die() as well but the result is the same.

Does anyone have any idea how to make the perl script return back to the parent shell script after catching the signal.

Thanks.
 

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:02 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0