This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Shell script loop runs out of memory


Buchbinder, Barry wrote:
> You might try changing
>     [[ condition ]]
> to
>     [ condition ]
> Perhaps single brackets use memory differently than double brackets.

They do: [[ condition ]] is interpreted by the shell; [ condition ] forks to
call /usr/bin/[.exe. If forking is the problem, that'll make it worse.

> If that doesn't work, try changing
>     #!/bin/sh
> (which calls bash) to
>     #!/bin/dash
> You will have to have retained the double to single bracket change,
> because dash does not have double brackets.  Perhaps dash is more
> efficient with memory than bash.

There's a whole bunch of other alternatives: ksh, zsh, ash, etc. If the
problem is forking, however, none of those are going to improve things.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]