This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Shell script loop runs out of memory
2012/6/1 AZ 9901:
> 2012/6/1 Adam Dinwoodie:
>> 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.
>>
>
> So some things to avoid while (bash)scripting under Cygwin to limit
> BLODA effect :
- | : pipe stdout --> stdin
- $(...) : subshell fork
- `...` : same as before, subshell fork
- [ condition ] : prefer [[ condition ]] construction
- ( instructions ) : prefer { instructions } construction if possible
- anything else from your point of view ?
Ben
--
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