[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
HISTCMD variable always returns 1 when used in PROMPT_COMMAND, bash 3.1
From: |
Arjen Meek |
Subject: |
HISTCMD variable always returns 1 when used in PROMPT_COMMAND, bash 3.1 |
Date: |
Sun, 25 Dec 2005 18:01:38 +0000 |
User-agent: |
Mutt/1.5.9i |
Hello,
I'm having a problem in bash 3.1 that I'm pretty sure is a bug. As
indicated in the subject, the HISTCMD variable always returns 1 when
used in PROMPT_COMMAND , rather than the actual number of the current
line in the history. This only occurs in 3.1, not in 3.0/3.0.16 (all
three downloaded from the gnu.org bash site and compiled on my debian
unstable system).
This demonstrates the problem clearly enough:
ar@gre#8167/0:~/src$ bash-3.1/bash
ar@gre#8166/0:~/src$ PROMPT_COMMAND='echo P_C ${HISTCMD}'
P_C 1
ar@gre#8167/0:~/src$ echo NORMAL: $HISTCMD
NORMAL: 8168
P_C 1
ar@gre#8168/0:~/src$ exit
ar@gre#8168/0:~/src$ bash-3.0.16/bash
ar@gre#8166/0:~/src$ PROMPT_COMMAND='echo P_C ${HISTCMD}'
P_C 8167
ar@gre#8167/0:~/src$ echo NORMAL: $HISTCMD
NORMAL: 8168
P_C 8168
Should it matter, my .bashrc is at http://xyx.nl/~arjen/bashrc.txt
Please CC any questions to me, I'm not on the list.
Arjen
- HISTCMD variable always returns 1 when used in PROMPT_COMMAND, bash 3.1,
Arjen Meek <=