• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shell-sandwich a file in 2 variable strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Shell-sandwich a file in 2 variable strings
      • From: Gnarlodious <email@hidden>
    • Re: Shell-sandwich a file in 2 variable strings
      • From: Christopher Nebel <email@hidden>
References: 
 >Re: Shell-sandwich a file in 2 variable strings (From: Chris Janton <email@hidden>)
 >Re: Shell-sandwich a file in 2 variable strings (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Regex in OS X
  • Next by Date: Re: Shell-sandwich a file in 2 variable strings
  • Previous by thread: Re: Shell-sandwich a file in 2 variable strings
  • Next by thread: Re: Shell-sandwich a file in 2 variable strings
  • Index(es):
    • Date
    • Thread