Ken Dawson <[EMAIL PROTECTED]> writes:

| Thanks for replying so quickly.
|
| Of course, I tried xargs first, and it works fine on Solaris, but on
| Linux (I'm using slackware 7.1), I get the following behavior:
|
|     >find /cdrom -type f | xargs md5sum
|     xargs: environment is too large for exec
|
| I don't understand which portion of the universe is responsible for
| specifying environment size, but it seems on Solaris to be determined by
| the value of ARG_MAX from /usr/include/limits.h.  It might be a POSIX
| thing.  I didn't find such a parameter in my Linux limits.h.

  $grep ARG_MAX /usr/include/linux/limits.h
  #define ARG_MAX       131072    /* # bytes of args + environ for exec() */

| I needed to get the task at hand done, so I felt that modifying md5sum
| was approachable.  Given the wide variety of configurations out there, it
| seemed that my mod might be useful to others.
|
| If you can give me an idea where to file my environment size complaint,

Things get into your environment via `setenv' (C shells) or
`export' (Bourne shells).  Check your shell's start-up files (usually
those matching .??*).

| I'll be glad to do so.  As I say, having this ability in md5sum may be
| useful beyond it's immediate appearance.  For instance, I was able to do
| the following:
|
|     find /cdrom -type f | md5sum -f - | (cd /; md5sum -c) | grep -v OK

Maybe you have a lot of data in your environment?
I see that xargs uses a 20k byte limit for my Linux system (that same
system has ARG_MAX = 131072).  Sounds like more than enough slack.

What does `env|wc -c' output?  If it's even close to 100k,
then I'll bet that's the problem.

Have you tried using xargs' -s option?  E.g.,

  ... | xargs -s 10000 md5sum | ...

Reply via email to