Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trapping & Exiting within a .ksh function

Status
Not open for further replies.

cptk

Technical User
Mar 18, 2003
305
US
I'd like to trap for certain events (e.g. ctrl-c, etc.) within a function I defined within my $ENV file (i.e. .kshrc file) and exit the function. The problem is is that if I use "exit", it terminates the window I'm calling it from.

example:

trap echo "...funt. terminated"; exit" 1 2 15

Can I exit from a function the way I normally would in a script file?
 
And this ?
trap echo "...funt. terminated"; return" 1 2 15

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
yeah, I just tried that ... it does the trick !!!
thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top