From: Laurent Julliard Date: 2002-08-13T16:18:28+09:00 Subject: Re: Catching script end? ts wrote: >>>>>>"L" == Laurent Julliard writes: >>>>> > > L> Are you aware of anyway to catch the end of a Ruby script execution when > L> there is no explicit exit instruction? > > Something like this ? > > pigeon% ruby -e 'at_exit { p "end" }' > "end" > pigeon% at_exit is exactly what I was looking for. I combined this with aliasing exit! to exit (at_exit doesn't catch exit!) in my ruby module and now I catch all exit events whether they come from and explicit exit/exit! or from an implicit exit Thanks for the tip! Laurent