Re: Bash high memory usage in simple for loop?

2010-09-27 Thread Chet Ramey
On 9/26/10 11:20 PM, Thomas Guyot-Sionnest wrote: > For instance I have 68M of small numbers (1..256) separated by newlines > and that makes bash grow over 1.6G, even when ann it does inside the > loop is calling true. The only way I can free up the memory is to leave > the shell. > > You can tes

Re: asking for a better way to implement this

2010-09-27 Thread Andre Majorel
On 2010-09-27 18:39 +0200, Christopher Roy Bratusek wrote: > I'm using GNU/Linux for seven years now, it's now almost > impossible to learn to use `xrm' instead of `rm'. Put rm(){su} in your .bashrc. You'll be surprised. :-> -- André Majorel http://www.teaser.fr/~amajorel/

Re: asking for a better way to implement this

2010-09-27 Thread Christopher Roy Bratusek
> > You might reinstall your OS one day, either due to hardware failure or > > simply upgrading. Then you might forget to build the rm alias. ... it's set by one of my applications and xrm is part of that applications script-chain. It's rc is called from .bashrc and that sets-up the alias. Whe

Re: asking for a better way to implement this

2010-09-27 Thread Chris F.A. Johnson
On Mon, 27 Sep 2010, Greg Wooledge wrote: On Mon, Sep 27, 2010 at 06:39:56PM +0200, Christopher Roy Bratusek wrote: It's a bad idea to alias rm. It would be better to use your xrm directly. If you alias rm and get in the habit of it protecting you, one of these days the alias won't be there and

Re: asking for a better way to implement this

2010-09-27 Thread Greg Wooledge
On Mon, Sep 27, 2010 at 06:39:56PM +0200, Christopher Roy Bratusek wrote: > > It's a bad idea to alias rm. It would be better to use your xrm > > directly. If you alias rm and get in the habit of it protecting you, > > one of these days the alias won't be there and OOPS, gone! > > Well... I know w

Re: asking for a better way to implement this

2010-09-27 Thread Christopher Roy Bratusek
> It's a bad idea to alias rm. It would be better to use your xrm > directly. If you alias rm and get in the habit of it protecting you, > one of these days the alias won't be there and OOPS, gone! Well... I know what you mean, but I'm using GNU/Linux for seven years now, it's now almost impossib

Re: asking for a better way to implement this

2010-09-27 Thread Christopher Roy Bratusek
Am Sun, 26 Sep 2010 18:09:16 -0400 (EDT) schrieb "Chris F.A. Johnson" : > On Sun, 26 Sep 2010, Christopher Roy Bratusek wrote: > > > btw. How can I remove the last arguement ${!#} ? > > > > I tried args=${@:-${!#}} but that won't work. > > args=( "$@" ) > unset args[$#-1] > set -- "${ar...@]}" >

Re: Bash high memory usage in simple for loop?

2010-09-27 Thread Greg Wooledge
On Sun, Sep 26, 2010 at 11:20:53PM -0400, Thomas Guyot-Sionnest wrote: > I just encountered some dubious behaviour... Feeding a large data set in > a "for i in..." loop doing nothing causes exponentially large memory > usage, and that memory is never freed (although is seems to be re-used > over mu