Re: Shell-sandwich a file in 2 variable strings
Re: Shell-sandwich a file in 2 variable strings
- Subject: Re: Shell-sandwich a file in 2 variable strings
- From: Michael Terry <email@hidden>
- Date: Fri, 6 Feb 2004 14:37:15 -0800
On Feb 5, 2004, at 11:54 PM, Christopher Nebel wrote:
Because this passes the contents of the file as a parameter to
echo(1), it will break if somefile contains more than kern.argmax
bytes (about 64K),
Was this upped in Panther? I remember reading this in the famous
technote, but I kept getting to pass a lot more data in my experiments.
I could never figure out how to get the right number, though. Different
UNIX implementations seem to keep argmax in different places by
different names. I grepped through different header files, but always
came up empty. Finally, a few weeks later, on an unrelated quest, I
found this:
sysctl kern.argmax
which showed me this:
kern.argmax = 262144
which jibes with what I was finding empirically.
Incidentally, the reason I wanted to know is because I was writing a
handler which was intended to be most efficient in context. If the data
to be passed to the shell was less than the limit I would send it
directly, otherwise I'd write a temp file. My experiments seemed to
suggest, however, that it was *always* fastest to write a temp file.
Maybe with very small arguments this was not the case--although it
might be even there--but then who's going to send hundreds or thousands
of 'do shell scripts' anyway?
Mike
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.