<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Scripting - /bin/grep: Argument list too long in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/scripting-bin-grep-argument-list-too-long/m-p/3675292#M20680</link>
    <description>You can use a pipe with the xargs command to solve the "argument list too long" issue.</description>
    <pubDate>Mon, 21 Nov 2005 06:39:35 GMT</pubDate>
    <dc:creator>Ivan Ferreira</dc:creator>
    <dc:date>2005-11-21T06:39:35Z</dc:date>
    <item>
      <title>Scripting - /bin/grep: Argument list too long</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scripting-bin-grep-argument-list-too-long/m-p/3675290#M20678</link>
      <description>Okay - go easy - just got back from Cabo San Lucas - so I'm not quite with it...&lt;BR /&gt;&lt;BR /&gt;Anyway - being postmaster, I had a to of email - 38,458 to be exact in my little inbox....&lt;BR /&gt;&lt;BR /&gt;I use Sendmai with Maildirs...&lt;BR /&gt;&lt;BR /&gt;So, I tried this:&lt;BR /&gt;&lt;BR /&gt;cd /var/mail/met.ca/gjwild/Maildir/cur&lt;BR /&gt;for i in `grep "To: postmaster" \`ls -l|grep "Nov" | awk '{print $9}'\` | awk -F:To '{print $1}'`; do rm -f $i; done&lt;BR /&gt;&lt;BR /&gt;Unfortunately, I get:&lt;BR /&gt; /bin/grep: Argument list too long&lt;BR /&gt;&lt;BR /&gt;So I tried &lt;BR /&gt;&lt;BR /&gt;grep "Nov 11"&lt;BR /&gt;&lt;BR /&gt;still no go...&lt;BR /&gt;&lt;BR /&gt;So I had to reduce further:&lt;BR /&gt;&lt;BR /&gt;grep "Nov 11 01"&lt;BR /&gt;&lt;BR /&gt;That works...but that means I have to run it for everey hour for every day - there has got ot be a better way.&lt;BR /&gt;&lt;BR /&gt;Thanks...Geoff&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 20 Nov 2005 11:34:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scripting-bin-grep-argument-list-too-long/m-p/3675290#M20678</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-11-20T11:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting - /bin/grep: Argument list too long</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scripting-bin-grep-argument-list-too-long/m-p/3675291#M20679</link>
      <description>&lt;BR /&gt;Hi there Geoff, how are you my friend!&lt;BR /&gt;&lt;BR /&gt;This is a relatively often heard (hurt ;-) problem. &lt;BR /&gt;Checking it out on &lt;A href="http://www.google.com/linux" target="_blank"&gt;www.google.com/linux&lt;/A&gt; &lt;BR /&gt;Searching for "Argument list too long"&lt;BR /&gt;Gives about a thousand hits&lt;BR /&gt;&lt;BR /&gt;The general solution is to use 'xargs'.&lt;BR /&gt;&lt;BR /&gt;You could also try rebuild a kernel with a change to:&lt;BR /&gt;&lt;BR /&gt;include/linux/binfmts.h&lt;BR /&gt;:&lt;BR /&gt;#define MAX_ARG_PAGES 32&lt;BR /&gt;&lt;BR /&gt;make it 64? more still?&lt;BR /&gt;&lt;BR /&gt;You failed to specify which Linux/version.&lt;BR /&gt;There may be specific solution for whatever you are running. &lt;BR /&gt;Be sure to read: &lt;A href="http://www.linuxjournal.com/node/6060/print" target="_blank"&gt;http://www.linuxjournal.com/node/6060/print&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Greetings from Nashua NH,&lt;BR /&gt;Hein.</description>
      <pubDate>Sun, 20 Nov 2005 12:47:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scripting-bin-grep-argument-list-too-long/m-p/3675291#M20679</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-11-20T12:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting - /bin/grep: Argument list too long</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scripting-bin-grep-argument-list-too-long/m-p/3675292#M20680</link>
      <description>You can use a pipe with the xargs command to solve the "argument list too long" issue.</description>
      <pubDate>Mon, 21 Nov 2005 06:39:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scripting-bin-grep-argument-list-too-long/m-p/3675292#M20680</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-11-21T06:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting - /bin/grep: Argument list too long</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scripting-bin-grep-argument-list-too-long/m-p/3675293#M20681</link>
      <description>Geoff,&lt;BR /&gt;&lt;BR /&gt;xargs would be the way to go...man xargs(1) and look-up its "-n" option also.&lt;BR /&gt;&lt;BR /&gt;cheers!</description>
      <pubDate>Tue, 22 Nov 2005 01:14:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scripting-bin-grep-argument-list-too-long/m-p/3675293#M20681</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-11-22T01:14:38Z</dc:date>
    </item>
  </channel>
</rss>

