Re: "bashbug" script

2007-08-14 Thread Chet Ramey
Jan Schampera wrote:

> I intentionally expected <() and >() to be as protected as $() is. Is
> there a specific reason for them to not be protected against the
> initial parsing?

Those sequences are not treated specially, but it's a reasonable
suggestion for a future enhancement.

Chet


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
   Live Strong.  No day but today.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/




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

2007-08-14 Thread Chet Ramey
Roland Eggner wrote:
> $ 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

Commands are stored in the history list well before being executed.  If
you would like to remove commands from the history based on exit status,
you are on the right track with testing $? in PROMPT_COMMAND.  Used with
`history -d', you can delete the previous command.  (The previous command
number can be obtained using $(history 1|awk '{print $1}') when
$PROMPT_COMMAND is executed.)

Keep in mind that commands evaluated while expanding $PS1 will change the
value of $?.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
   Live Strong.  No day but today.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/