Source Output - Page 2 | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Source Output

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #8  
Old 10-11-2012
bakunin bakunin is online now Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 18 September 2014, 7:34 AM EDT
Location: In the leftmost byte of /dev/kmem
Posts: 4,248
Thanks: 45
Thanked 816 Times in 643 Posts
Quote:
Originally Posted by Don Cragun View Post
Obviously, the commands specified by the action in a trap action EXIT command won't be executed if the shell is terminated by a SIGKILL signal since the shell can't catch a SIGKILL to invoke the actions specified by appropriate traps.
True. This notable exception i have explicitly stated (in post #4, last line). It is because of the nature of this signal, which is not directed at the process but rather at the kernel. A process terminated by SIGKILL doesn't terminate itself, but rather is terminated by the kernel.

Quote:
If the standard is interpreted as you expect, then no system conforms to the standard because the standard doesn't allow an exception for being terminated by SIGKILL.
Actually what i tried to get across was: save for SIGKILL, any other way of terminating a script (simple end, send a SIGTERM via "kill -15", press "CTRL-C", ...) will result in trap 0 (EXIT) being executed - not just using the "exit" built-in.

This is in fact as it should be because a script terminated by "kill -9" probably best leaves its temporary files for further inspection (one wouldn't terminate a script this way without some serious reason) and all other methods of ending a script are covered.

Thanks for sharing your thoughts.

bakunin
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Redirect output to a different text file depending source of data spartan22 Shell Programming and Scripting 4 07-17-2012 10:10 AM
Read rows from source file and concatenate output carlos_anubis UNIX for Dummies Questions & Answers 0 07-22-2010 09:44 AM
write page source to standard output wxornot Shell Programming and Scripting 1 07-18-2008 04:46 PM
how to make a line BLINKING in output and also how to increase font size in output mail2sant Shell Programming and Scripting 3 04-14-2008 07:30 AM



All times are GMT -4. The time now is 07:40 AM.