bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FEATURE REQUEST: when storing history, skip failed commands depending on


From: Roland Eggner
Subject: FEATURE REQUEST: when storing history, skip failed commands depending on exit status
Date: Mon, 6 Aug 2007 02:04:33 +0200
User-agent: KMail/1.9.6

$ bash --version
GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu)

Description:
        FEATURE REQUEST:
        when storing history, skip failed commands depending on exit status, 
controlled by a third option "ignorefailed" added to HISTCONTROL

        failed command lines stored in ~/.bash_history are mostly useless 
cluttering my bash history
        if a command failed due to a typo, and I issue a second, corrected 
version of the command line, it would be VERY nice, having ONLY the second 
version stored in bash history, NOT the failed first version

        if possible, should handle case (b) additionally to (a):
        (a)  use history facilities to reedit the failed command line
        (b)  retype corrected command line completely without unsing history 
facilities

        I tried PROMPT_COMMAND='PrStat=$?;SomeOtherCommands;if [ "$PrStat" == 
"0" ] ; then .. ' and similar, when bash executes this $PROMPT_COMMAND, $PrStat 
is ALWAYS empty, in addition $HISTCMD always empty .. I gave up.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]