Patrice Dumas wrote:
> > dist-hook: dist-many-files
> > 
> > dist-many-files:
> >     $(MKDIR_P) $(distdir)/
> >     for file in `cat $(srcdir)/many-files.txt`; do \
> >       if test -f $$file; then d=.; else d=$(srcdir); fi; \
> >       cp -p $$d/$$file $(distdir)/$$file || exit 1; \
> >     done
> 
> Wouldn't "in `cat $(srcdir)/many-files.txt`" as for argument suffer from
> the same length issue?

No, because that's internal processing of the shell. The
"Argument list too long" error comes from the exec* system call.

See:

$ for i in `seq 1000000`; do echo 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
 done > 1e6files.txt
$ for i in `seq 10000000`; do echo 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
 done > 1e7files.txt
$ ls -l 1*
-rw-rw-r-- 1 bruno bruno  200000000  3. Sep 18:05 1e6files.txt
-rw-rw-r-- 1 bruno bruno 2000000000  3. Sep 18:03 1e7files.txt
$ /bin/true `cat 1e6files.txt`
bash: /bin/true: Argument list too long
$ true `cat 1e6files.txt`
$ for f in `cat 1e6files.txt`; do echo; done | wc -c
1000000
$ for f in `cat 1e7files.txt`; do echo; done | wc -c
10000000

Bruno




  • &quo... Bruno Haible via Bug reports for the GNU Texinfo documentation system
    • ... Gavin Smith
    • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
      • ... Patrice Dumas
    • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
      • ... Patrice Dumas
        • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
          • ... Patrice Dumas
            • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
              • ... Patrice Dumas
                • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
                • ... Patrice Dumas

Reply via email to