Tim Connors <[EMAIL PROTECTED]>:
>Package: bash
>Version: 3.0-16
>Severity: wishlist
>I like to do a bit of complicated processing on exiting any shell I
>run (saving history, etc). Currently, the only way to do this, is to
>use a login shell, instead of a normal shell, so that .bash_logout can
>be sourced at exit.
>This means, since I want all of my xterms to save history, with
>appropriate file locking, that all of my xterms have to be login
>shells, defeating the purpose of a login shell vs non-login shell
>differentiation.
No, they need not be login shells. Put the following lines in
"$HOME"/.bashrc:
my_at_exit ()
{
# put the commands to execute on exit here
cd
. ~/.bash_logout
}
# set trap on shell exit
trap my_at_exit 0
# If you want my_at_exit to be executed too when the shell catches
# certain signals (here SIGHUP), you need the following line to
# convert the catching of a SIGHUP into a normal shell exit.
trap 'exit 2' HUP
>Could we include a file that can be sourced at exit of a normal shell?
That is not necessary. Traps do work.
--
Bitte in die Adressierung auch meinen|Please put my full name also into
Vor- u. Nachnamen stellen z.B. |the recipient like
Friedhelm Waitzmann <[EMAIL PROTECTED]>, (Friedhelm Waitzmann) [EMAIL
PROTECTED],
"Waitzmann, Friedhelm" <[EMAIL PROTECTED]>
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]