[Top][All Lists]

[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 (Macintosh/20080421)

chuli wrote:
        For bash-3.1 and bash-3.2, I write a script a.sh like this:
        history abc
        echo "FAIL"

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

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

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

reply via email to

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