|
From: | Noilson Caio |
Subject: | Re: Bash monopolizing or eating the RAM MEMORY |
Date: | Mon, 20 Mar 2017 16:09:02 -0300 |
On Mon, Mar 20, 2017 at 03:54:37PM -0300, Noilson Caio wrote:
> thank you so much Mr. Wooledge. i guess that BUG is a strong word for this
> case. i fully agree about "his is not a bash bug. It's a problem with your
> approach.", actuality that's my preoccupation. can you help me to
> understand because 10^6 strings pull the trigger of "Argument list too
> long" and 10^7(n+1) don't ? i have afraid that a non-root user can
> compromise a linux box intentionally. the memory needs be eaten until other
> threshold can break it.
It's not a "compromise". Any user on a computer can run a program that
uses (or tries to use) a bunch of memory. You as the system admin can
set resource limits on the user's processes. This is outside the scope
of the bug-bash mailing list (try a Linux sys admin list).
As far as "argument list too long", I believe you already posted a link
to Sven Mascheck's ARG_MAX web page. This is the best explanation of
the concept and the details. For those that may have missed it,
see http://www.in-ulm.de/~mascheck/various/argmax/
If you want to create 1 million (or 10 million) directories from a bash
script, you're going to have to call mkdir repeatedly. If this is a
problem, then I suggest you rewrite in a langauge that can call mkdir()
as a function without forking a whole process to do so. Pretty much
every language that isn't a shell should allow this. Pick your favorite.
[Prev in Thread] | Current Thread | [Next in Thread] |