<?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: Parameter list is too long. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930439#M409898</link>
    <description>Oops; my mistake.  Misread where the error was coming from...  &lt;BR /&gt;&lt;BR /&gt;I'd still keep the xargs command in your loop; however, you can avoid the potential buffer overflow by:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NEW=00&lt;BR /&gt;for EACHONE in $(find /interface/web -name D\* -exec ls -dl {} \; | cut -f2 -dD | cut -f1 -d_)&lt;BR /&gt;do&lt;BR /&gt;if [ "${NEW}" -ne "${EACHONE}" ]; then&lt;BR /&gt;NEW=$EACHONE&lt;BR /&gt;EACHONE=`expr $EACHONE \* 1`&lt;BR /&gt;EACHONE=`expr $EACHONE - 1`&lt;BR /&gt;find /interface/web/ -name D$NEW*.* -mtime +$EACHONE -print | xargs -i rm {}&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Sorry for the confusion...&lt;BR /&gt;&lt;BR /&gt;Doug</description>
    <pubDate>Fri, 30 Sep 2005 07:33:54 GMT</pubDate>
    <dc:creator>Doug O'Leary</dc:creator>
    <dc:date>2005-09-30T07:33:54Z</dc:date>
    <item>
      <title>Parameter list is too long.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930433#M409892</link>
      <description>Hello There...&lt;BR /&gt;I have a Script that removes logs with "x" days in a directory of my HPUX 11i server.&lt;BR /&gt;The logs are generated following a standard:&lt;BR /&gt;Dxx_LOG_NAME.log, where xx is the number of days we have to retain the log.&lt;BR /&gt;The scripts is this:&lt;BR /&gt;&lt;BR /&gt;DAY=$(ls -1 /interface/web/D* |cut -f2 -dD |cut -f1 -d_)&lt;BR /&gt;&lt;BR /&gt;NEW=00&lt;BR /&gt;for EACHONE in $DAY&lt;BR /&gt;  do&lt;BR /&gt;    if [ "${NEW}" -ne "${EACHONE}" ]; then&lt;BR /&gt;      NEW=$EACHONE&lt;BR /&gt;      EACHONE=`expr $EACHONE \* 1`&lt;BR /&gt;      EACHONE=`expr $EACHONE - 1`&lt;BR /&gt;      find /interface/web/ -name D$NEW*.* -mtime +$EACHONE -print -exec rm {} \;&lt;BR /&gt;    fi &lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;----------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Sometimes I'm receiving this message:&lt;BR /&gt;&lt;BR /&gt;sh: /usr/bin/ls: The parameter list is too long.&lt;BR /&gt;&lt;BR /&gt;Do you Know How can I avoid it?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Rafael&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Sep 2005 06:46:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930433#M409892</guid>
      <dc:creator>Rafael Mendonça Braga</dc:creator>
      <dc:date>2005-09-30T06:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter list is too long.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930434#M409893</link>
      <description>You are hitting MAX_ARGS limit. Pipe the output and then do args on it to do what you want.</description>
      <pubDate>Fri, 30 Sep 2005 06:54:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930434#M409893</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-09-30T06:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter list is too long.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930435#M409894</link>
      <description>ls -1 &amp;gt; file&lt;BR /&gt;&lt;BR /&gt;while read -r filename&lt;BR /&gt;do&lt;BR /&gt;   rm -f $filename&lt;BR /&gt;#  or any other operation you want to accomplish.&lt;BR /&gt;done &amp;lt; file&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 30 Sep 2005 07:03:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930435#M409894</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-09-30T07:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter list is too long.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930436#M409895</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You are causing the shell to collect create a list that is too long.  Change the way you drive your script to leverage the 'find' of the directory, like:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;cd /interface/web&lt;BR /&gt;find . -type f |&lt;BR /&gt;while read FILE&lt;BR /&gt;do&lt;BR /&gt;  ...&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Sep 2005 07:07:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930436#M409895</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-09-30T07:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter list is too long.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930437#M409896</link>
      <description>Rafael,&lt;BR /&gt;use find instead of ls to solve the issue.&lt;BR /&gt;Re&lt;BR /&gt;      Roy</description>
      <pubDate>Fri, 30 Sep 2005 07:12:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930437#M409896</guid>
      <dc:creator>Roy Colica</dc:creator>
      <dc:date>2005-09-30T07:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter list is too long.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930438#M409897</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;Although the other posts would work, RAC mentioned the correct answer:&lt;BR /&gt;&lt;BR /&gt;DAY=$(ls -1 /interface/web/D* |cut -f2 -dD |cut -f1 -d_)&lt;BR /&gt;&lt;BR /&gt;NEW=00&lt;BR /&gt;for EACHONE in $DAY&lt;BR /&gt;do&lt;BR /&gt;if [ "${NEW}" -ne "${EACHONE}" ]; then&lt;BR /&gt;NEW=$EACHONE&lt;BR /&gt;EACHONE=`expr $EACHONE \* 1`&lt;BR /&gt;EACHONE=`expr $EACHONE - 1`&lt;BR /&gt;find /interface/web/ -name D$NEW*.* -mtime +$EACHONE -print | xargs -i rm {}&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The trick is the xargs pipe from the find command.  Minor tweak.&lt;BR /&gt;&lt;BR /&gt;HTH;&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Fri, 30 Sep 2005 07:27:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930438#M409897</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2005-09-30T07:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter list is too long.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930439#M409898</link>
      <description>Oops; my mistake.  Misread where the error was coming from...  &lt;BR /&gt;&lt;BR /&gt;I'd still keep the xargs command in your loop; however, you can avoid the potential buffer overflow by:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NEW=00&lt;BR /&gt;for EACHONE in $(find /interface/web -name D\* -exec ls -dl {} \; | cut -f2 -dD | cut -f1 -d_)&lt;BR /&gt;do&lt;BR /&gt;if [ "${NEW}" -ne "${EACHONE}" ]; then&lt;BR /&gt;NEW=$EACHONE&lt;BR /&gt;EACHONE=`expr $EACHONE \* 1`&lt;BR /&gt;EACHONE=`expr $EACHONE - 1`&lt;BR /&gt;find /interface/web/ -name D$NEW*.* -mtime +$EACHONE -print | xargs -i rm {}&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Sorry for the confusion...&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Fri, 30 Sep 2005 07:33:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930439#M409898</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2005-09-30T07:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter list is too long.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930440#M409899</link>
      <description>Thanks Guys!!!&lt;BR /&gt;&lt;BR /&gt;It's Working!</description>
      <pubDate>Fri, 30 Sep 2005 07:37:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parameter-list-is-too-long/m-p/4930440#M409899</guid>
      <dc:creator>Rafael Mendonça Braga</dc:creator>
      <dc:date>2005-09-30T07:37:28Z</dc:date>
    </item>
  </channel>
</rss>

