<?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: Help on the shell script. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794052#M265458</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can generate an option list for find:&lt;BR /&gt;&lt;BR /&gt;prune_dir_list='PSDSTSRVLOG PSPRCSRVLOG TUXLOG TUXLOG2 TUXLOG3 TUXLOG4'&lt;BR /&gt;&lt;BR /&gt;findopt='-mtime +30'&lt;BR /&gt;for entry in $prune_dir_list&lt;BR /&gt;do findopt=$findopt" -name $entry -prune -o"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;find /psoft $findopt -print ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
    <pubDate>Wed, 24 May 2006 11:49:21 GMT</pubDate>
    <dc:creator>Peter Nikitka</dc:creator>
    <dc:date>2006-05-24T11:49:21Z</dc:date>
    <item>
      <title>Help on the shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794048#M265454</link>
      <description>My following command is working fine, but now the number of directory names I need to prune is getting bigger in turns this command is getting larger and larger.&lt;BR /&gt;&lt;BR /&gt;find /psoft -mtime +30 -name "PSDSTSRVLOG" -prune -o -name "PSPRCSRVLOG" -prune -o -name "TUXLOG" -prune -o -print | xargs rm -rf&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is there any way I can shorten this command while accommodating more directory names?&lt;BR /&gt;&lt;BR /&gt;for examles.&lt;BR /&gt;&lt;BR /&gt;prune_dir_list=PSDSTSRVLOG PSPRCSRVLOG TUXLOG TUXLOG2 TUXLOG3 TUXLOG4..&lt;BR /&gt;&lt;BR /&gt;find /psoft -mtime +30 -name $prune_dir_list -prune  -o -print | xargs rm -rf&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Gulam.</description>
      <pubDate>Wed, 24 May 2006 09:05:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794048#M265454</guid>
      <dc:creator>Gulam Mohiuddin</dc:creator>
      <dc:date>2006-05-24T09:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help on the shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794049#M265455</link>
      <description>You should have no problems.&lt;BR /&gt;&lt;BR /&gt;prune_dir_list="PSDSTSRVLOG PSPRCSRVLOG TUXLOG TUXLOG2 TUXLOG3 TUXLOG4"&lt;BR /&gt;for x in $prune_dir_list&lt;BR /&gt;do&lt;BR /&gt;find /psoft -mtime +30 -name ${x} -prune -o -print | xargs rm -rf&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Wed, 24 May 2006 09:11:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794049#M265455</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2006-05-24T09:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help on the shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794050#M265456</link>
      <description>Hi Gulam:&lt;BR /&gt;&lt;BR /&gt;You could use a pattern file with 'grep' to perform filtration, something like:&lt;BR /&gt;&lt;BR /&gt;# find /path -xdev -type f -mtime +30 | grep -v -f /tmp/skippatterns | xargs ls -l&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 24 May 2006 09:12:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794050#M265456</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-05-24T09:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help on the shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794051#M265457</link>
      <description>Gulam,&lt;BR /&gt;you may also want to have a look at the gnu version of find, which has a wide range of additional useful parameters, documented at:&lt;BR /&gt;&lt;A href="http://www.gnu.org/software/findutils/manual/html_mono/find.html" target="_blank"&gt;http://www.gnu.org/software/findutils/manual/html_mono/find.html&lt;/A&gt;</description>
      <pubDate>Wed, 24 May 2006 09:20:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794051#M265457</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-05-24T09:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help on the shell script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794052#M265458</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can generate an option list for find:&lt;BR /&gt;&lt;BR /&gt;prune_dir_list='PSDSTSRVLOG PSPRCSRVLOG TUXLOG TUXLOG2 TUXLOG3 TUXLOG4'&lt;BR /&gt;&lt;BR /&gt;findopt='-mtime +30'&lt;BR /&gt;for entry in $prune_dir_list&lt;BR /&gt;do findopt=$findopt" -name $entry -prune -o"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;find /psoft $findopt -print ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Wed, 24 May 2006 11:49:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-on-the-shell-script/m-p/3794052#M265458</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-05-24T11:49:21Z</dc:date>
    </item>
  </channel>
</rss>

