Re: possible bash bug - 'history'

2013-08-09 Thread Chet Ramey
On 7/19/13 11:23 AM, Mike Fied wrote:
> Dear GNU developer/code maintainer,
> 
> Please take a second to take a look at this problem - this might or might
> not be a bug, or rather a feature is not implemented in BASH:
> I am trying to get the current or "last" command line printed as the result
> of history, or a BASH variable ( to my knowledge it does not exist )
> 
> # echo "blah_blah" ; echo "$THIS_CMD_LINE" ( or history -n0 )
> 
> 
> I can do this in ksh:
> # hist -l -n0
> ( will output the same, in this case "hist -l -n0" )

This is an interesting feature request.  Right now, -0 is treated
the same as -1 on the assumption that nobody wants to operate on the
actual fc command itself, and 0 is treated the same as -0 because that
makes sense.

It's not really a Posix issue because Posix doesn't mention 0 (only
positive and negative integers), and different shells claiming posix
compatibility do different things.  And there's internally inconsistent
behavior: fc -l -n0 and fc -l -n 0 do different things in ksh93, for
instance.

So is there enough of a need to make 0 do something different?  Or does
$BASH_COMMAND suffice? (I suspect the answer to that question is "no",
because it deals with commands rather than input lines.)

What do folks think?

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/



memory allocation bug in bash 4.2.39(1)-release

2013-08-09 Thread John Vincent
I'm using bash 4.2.39(1)-release, part of Fedora release 17 (Beefy Miracle)
 
I find that if I enter the command:
 
echo {1..2000}
 
it runs, but afterwards whenever I enter another command I get the error:
 
-bash: fork: Cannot allocate memory
 
I guess that the memory allocated to all those numbers on the echo command line 
is not freed properly.
 
Thanks,
John Vincent.
 
 
  

Re: memory allocation bug in bash 4.2.39(1)-release

2013-08-09 Thread Bob Proulx
John Vincent wrote:
> I find that if I enter the command:
> echo {1..2000}
> it runs, but afterwards whenever I enter another command I get the error:
> -bash: fork: Cannot allocate memory

You need to allocate more virtual memory space to your machine.  You
are asking it to do more than it can do with the memory it has
available.

> I guess that the memory allocated to all those numbers on the echo
> command line is not freed properly.

This has been discussed previously.  Please see this message thread
for the previous discussion.

  http://lists.gnu.org/archive/html/bug-bash/2011-11/msg00181.html

Bob