next up previous 405
Next: Longer recipes
Up: C-shell Cookbook
Previous: Debugging scripts


Breaking-in

Sometimes you will realise you have made a mistake after starting a script, and therefore want to stop it to save time or damage. You can break-in using CTRL/C (hitting C while depressing the CTRL key), but doing this can leave unwanted intermediate files, graphics windows, and other mess. However, if you have

     onintr label

     <the main body of the script>

     label:
     <perform housekeeping>

     exit
near the head and tail of your script, whenever CTRL/C is detected, the script will go to the specified label. There you can close down the script in a controlled fashion, removing the garbage. If you want to prevent CTRL/C interrupts, you should include the line

     % onintr -
instead.



next up previous 405
Next: Longer recipes
Up: C-shell Cookbook
Previous: Debugging scripts

C-shell Cookbook
Starlink Cookbook 4
Malcolm J. Currie
2006 November 26
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council