help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: working around "execvp: echo: Argument list too long"?


From: Matthias Wenzel
Subject: Re: working around "execvp: echo: Argument list too long"?
Date: Wed, 10 Sep 2008 13:35:41 +0200
User-agent: Thunderbird 2.0.0.14 (X11/20080603)

Stephan Beal wrote:
On Wed, Sep 10, 2008 at 12:03 PM, Matthias Wenzel <address@hidden> wrote:
      for i in `seq 10000` ; do \
        echo "LARGE_VAR+=some_value_$$i" >> largefile.mak ; \
      done

One way to do it would be to break it into several loops. Assuming the
bash shell, you could do something like (untested):

for x in 1 2 3 4 5 6 7 8 9 10; do \
  t=$$((x * 1000); \
  for i in `seq $$((t - 999)) $$t`; do \
    echo ... ; \
  done; \
done >> largefile.make

that is, instead of one long loop, it's now 10 smaller loops (but with
10000 entries, you might need to do even more loops of smaller
iterations).

uhm, thats a fix for the wrong part of the makefile =)

the for-loop was just a quick hack to overflow the environment-space of the SHELL (and maybe to show that make-vars can hold much more memory than a processes environment).

In my real-world-makefile, the variable is created by many complex calculations, which are not part of a make-target.
In short: I need a replacement for the "@echo $(LARGE_VAR)"-line

Matthias





reply via email to

[Prev in Thread] Current Thread [Next in Thread]