Red Hat Bugzilla – Bug 136264
add PREEXEC_COMMAND variable to bash?
Last modified: 2007-11-30 17:10:52 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Description of problem:
At the url you'll find some info in German on a patch against
bash-2.05b (written by Rene van Bevern) which enables a
PREEXEC_COMMAND. The "value" of this variable "is executed as a
command prior to executing entered commands in interactive mode". (zsh
seems to have a preexec function for that.) It also introduces the CMD
variable which is "set before a command is run, each array field
corresponds to one argument of the command line. It is intended to
be used in PREEXEC_COMMAND scripts."
Together these variables make it possible to set the title of an xterm
(such as gnome-terminal) to the name of the current job! AFAIK this
cannot be done by using PROMPT_COMMAND. This of course makes it much
easier to see what your xterm(s) is (are) doing and choose the right
xterm from you panel.
The patch "builds" cleany against bash-2.05b-38. I haven't examined
the patch very thoroughly (but at first glance I did not spot anything
suspicious). I'll attach it right away ...
Question: should I ask the maintainers upstreams what they think of
Version-Release number of selected component (if applicable):
Created attachment 105405 [details]
Rene van Beveren's patch
Note that I edited the patch slightly (only in the diff "headers") so that I
could use it as a patch "against" (the source found in) bash-2.05b-38.src.rpm.
Hmmm ... it seems I edited the headers not too well. At least rpmbuild
Thanks for the suggestion.
I think this is the sort of thing you'll need to talk to the upstream
maintainer (Chet Ramey) about. You'll need to add documentation to
the info pages etc.