My script runs from CRT application (telnet, ssh, serial, ...
application). In the script, I create a temporary file who contains
instructions to push to CRT window and log information are pushed in an
history log file.

Now, i would like to remove temporary file and close history file when
the script is finished (on error, on abort or at the end on script)

Any idea ?

Thanks