EchoAngel has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I have this Makefile and this one target has 4 foreach loops. An Example would be.
$foreach( TYPE , $strip($(shell ls *.nt0)), $(perlScript) -argA "A" - +ArgB "B" -File "$(TYPE)" )
Getting argument list too long. My guess is that the coding line within the foreach is reaching a limitation? If so, my idea was to make a perl script to take the files (ls *.nt0) and the $(perlScript) and go through a foreach within this batch perl script.

Replies are listed 'Best First'.
Re: Execvp : /bin/csh : Argument List Too Long
by hawtin (Prior) on Sep 15, 2004 at 13:36 UTC

    Yes, the standard version of /bin/csh only allows for 256(ish) characters in each line. One option is to use another shell (for example tcsh removes the restriction and, for your purposes is completely compatible)

      LIMITATIONS Words can be no longer than 1024 characters. The system limits argument lists to 10240 characters. I found this and when I tried this shell, I still get the same error.
Re: Execvp : /bin/csh : Argument List Too Long
by castaway (Parson) on Sep 16, 2004 at 09:13 UTC
    I'm not sure what your overall goal is, but can you use glob or find instead? Both these would workaround your problem.

    C.