bug-bash
[Top][All Lists]
Advanced

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

Re: Command can't be executed after "history abc"


From: Chet Ramey
Subject: Re: Command can't be executed after "history abc"
Date: Tue, 03 Jun 2008 14:57:14 -0400
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

chuli wrote:
Hi,
        For bash-3.1 and bash-3.2, I write a script a.sh like this:
Test(){
        history abc
        echo "FAIL"
        }
Test

Execute "bash a.sh", and "FAIL" can't be printed. Why should 'history' be 
designed like this?
I think it's better to continue execute the next command even if history is fail. (it seems "history abc" will use "get_numeric_arg" which calls "jump_top_level", so "echo FAIL" can't be executed)

I agree.  `history' with an invalid numeric argument aborts the current
top-level command, which in this case is the function call.  It should
be less aggressive about such failures.  The behavior will change in
bash-4.0.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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