]
] 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() */
ARG_MAX is at least 1048320 on Solaris.
]
] | 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 .??*).
As well, bash seems to insist on putting my functions into the
environment, and that produces some unnecessary baggage; I haven't
figured out how to get it to stop; as I recall, I can tell it to do so,
but I can't tell it not to.
]
] | 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.
on Linux, I get
>env | wc -c
21346
on Solaris, I get
>env | wc -c
23494
Not too dissimilar. Removing the function definitions, I get 9422 on
Solaris.
]
] Have you tried using xargs' -s option? E.g.,
]
] ... | xargs -s 10000 md5sum | ...
]
I just tried this, but that didn't help. It even dies on 'xargs
--help'.