title: Why do I get "/bin/sh: Argument list too long" when passing quoted arguments?
body: <p>How long can be a command line that can be passed to <code>sh -c ''</code>? (in bash and in bourne shell)</p>
  
  <p>The limit is much lower than that from the OS (in case of modern Linux).</p>
  
  <p>For example:</p>
  
  <pre><code>$ /bin/true $(seq 1 100000)
  $ /bin/sh -c "/bin/true $(seq 1 100000)"
  bash: /bin/sh: Argument list too long
  </code></pre>
  
  <p>And how could I circumvent this problem?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I want to note that <code>getconf</code> can't help here (because that is not a system limit):</p>
  
  <pre><code>$ seq 1 100000 | wc -c
  588895
  $ getconf ARG_MAX
  2097152
  </code></pre>
  
  <p><strong>Update #2</strong></p>
  
  <p>Now I've understood what is the point here. That is not a shell limit, that is a system limit but for the length of each argument, not for the entire arglist.</p>
  
  <pre><code>$ /bin/true $(seq 1 100000)
  $ /bin/true "$(seq 1 100000)"
  bash: /bin/true: Argument list too long
  </code></pre>
  
  <p>Thank you, CodeGnome, for the explanation.</p>