Description of problem:
If $HISTTIMEFORMAT is inherited through the environment, instead of being set by .bashrc or manually, then it works as expected for displaying history, but does not cause timestamps to be written into the history file.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. ensure no shell startup files set HISTTIMEFORMAT
2. HISTFILE=testfile HISTTIMEFORMAT="%T %F " bash
3. run some commands, run 'history' and see timestamps
4. exit the subshell and examine testfile
command history stored without timestamps
commands interspersed with timestamps
Seems to have been fixed in RHEL6 (bash 4.1.2).
We use wrapper scripts to start special purpose shells for which we'd like to capture history with timestamps. A backport of the fix to RHEL5 would be great.
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
RHEL-5.10 (the next RHEL-5 minor release) is going to be the first production phase 2  release of RHEL-5. Since phase 2 we'll be addressing only security and critical issues.