Package: bash
Version: 3.1-1
Severity: wishlist
There exists the special variable $_, which contains the last arg of
the last command executed, amongst other things. It would be nice if
there were a special array that contained all args and program name of
last command to be executed (either in the foreground or background).
That way, I could use a trap that does the following:
set -e
trap "finalise" 0 HUP QUIT INT
function finalise() {
echo "failed on `hostname` at `date` -- last job to fail was
\"${LASTCMD[*]}\" with exit code $?"
...
trap - 0
exit 1
}
...
trap - 0
Thanks.
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1,
'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12.3
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)
Versions of packages bash depends on:
ii base-files 3.1.9 Debian base system miscellaneous f
ii debianutils 2.15.2 Miscellaneous utilities specific t
ii libc6 2.3.5-9 GNU C Library: Shared libraries an
ii libncurses5 5.5-1 Shared libraries for terminal hand
bash recommends no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]