<?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: Shell script help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422978#M682385</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The echo command is displaying the message on the screen. I want the message to go the file. I do not want any message onscreen.&lt;BR /&gt;&lt;BR /&gt;OK, then change the line that tests for a zero-size file to be:&lt;BR /&gt;&lt;BR /&gt;[ -s ${TEMP} ] || echo "NO orphaned files exist" &amp;gt;&amp;gt; ${TEMP}&lt;BR /&gt;&lt;BR /&gt;If there are orphaned files then they will be listed in your ${TEMP} file.  If there are none, the string "NO orphaned file exist" will be present instead.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 21 May 2009 14:11:44 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-05-21T14:11:44Z</dc:date>
    <item>
      <title>Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422961#M682368</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am trying to find unowned files on hundreds of servers using the following script. I am new to scripting and have an error. could someone help me in debugging it please.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;OSTYPE=`uname -a | cut -d" " -f1`&lt;BR /&gt;print "MSG: OS type is $OSTYPE."&lt;BR /&gt;LOGFILE=/tmp/unowned_file&lt;BR /&gt; &lt;BR /&gt;  if [[ $OSTYPE = "HP-UX"]]&lt;BR /&gt;  then&lt;BR /&gt;  find /-xdev -nouser -o -nogroup &amp;gt;&amp;gt; ${LOGFILE}                                                                              &lt;BR /&gt; &lt;BR /&gt;  if [[ $? = "0" ]]                                                                                                          &lt;BR /&gt;  print "MSG: No unowned files found." &amp;gt;&amp;gt; ${LOGFILE}                                                                         &lt;BR /&gt;  else&lt;BR /&gt;  print "MSG: Unowned files found" &amp;gt;&amp;gt; ${LOGFILE}&lt;BR /&gt;  fi&lt;BR /&gt;  elif [[ $OSTYPE = "AIX"]]&lt;BR /&gt;  then&lt;BR /&gt;  find / -nouser -o -nogroup &amp;gt; ${LOGFILE}&lt;BR /&gt;  print "MSG: No unowned files found." &amp;gt; ${LOGFILE}&lt;BR /&gt;  else&lt;BR /&gt;  print "MSG: Unowned files found" &amp;gt; ${LOGFILE}&lt;BR /&gt;  fi&lt;BR /&gt;  exit 0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 19 May 2009 20:11:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422961#M682368</guid>
      <dc:creator>shell script</dc:creator>
      <dc:date>2009-05-19T20:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422962#M682369</link>
      <description>sorry, forgot to post the error.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;./find[6]: 0403-057 Syntax error at line 8 : `then' is not expected.</description>
      <pubDate>Tue, 19 May 2009 20:15:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422962#M682369</guid>
      <dc:creator>shell script</dc:creator>
      <dc:date>2009-05-19T20:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422963#M682370</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;one cause is the missing 'then' in your statement, checking the return value.&lt;BR /&gt;Next, there is no space between the directory parameter '/' and the find-option(s).&lt;BR /&gt;More, there is no need to diddle with 'uname -a'.&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;OSTYPE=`uname -s`&lt;BR /&gt;print "MSG: OS type is $OSTYPE."&lt;BR /&gt;LOGFILE=/tmp/unowned_file&lt;BR /&gt;&lt;BR /&gt;case $OSTYPE in&lt;BR /&gt;HP-UX) findopt='-xdev '\( -nouser -o -nogroup \)' ;;&lt;BR /&gt;AIX) findopt='-local \( -nouser -o -nogroup \)'  ;;&lt;BR /&gt;*) findopt='\( -nouser -o -nogroup \)' ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;find / $findopt -print &amp;gt; ${LOGFILE}&lt;BR /&gt;&lt;BR /&gt;if [ -s $LOGFILE ]; then&lt;BR /&gt;print "MSG: No unowned files found." &lt;BR /&gt;else&lt;BR /&gt;print "MSG: Unowned files found"&lt;BR /&gt;fi &amp;gt;&amp;gt; ${LOGFILE}&lt;BR /&gt;&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 19 May 2009 20:27:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422963#M682370</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2009-05-19T20:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422964#M682371</link>
      <description>Thanks but i still have an error.&lt;BR /&gt;&lt;BR /&gt;Syntax error at line 9 : `'' is not matched.</description>
      <pubDate>Tue, 19 May 2009 20:36:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422964#M682371</guid>
      <dc:creator>shell script</dc:creator>
      <dc:date>2009-05-19T20:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422965#M682372</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;This appears to be a continuation of your thread here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1341268" target="_blank"&gt;http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1341268&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If so, you should continue your queries there.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 19 May 2009 20:37:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422965#M682372</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-19T20:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422966#M682373</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Syntax error at line 9 : `'' is not matched.&lt;BR /&gt;&lt;BR /&gt;Yes, you have an extra single quote in the line _before_ that.&lt;BR /&gt;&lt;BR /&gt;You have:&lt;BR /&gt;&lt;BR /&gt;HP-UX) findopt='-xdev '\( -nouser -o -nogroup \)' ;;&lt;BR /&gt;&lt;BR /&gt;...which should be:&lt;BR /&gt;&lt;BR /&gt;HP-UX) findopt='-xdev \( -nouser -o -nogroup \)' ;;&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Tue, 19 May 2009 20:42:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422966#M682373</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-19T20:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422967#M682374</link>
      <description>Thanks, JRF -&lt;BR /&gt;&lt;BR /&gt;I should have used my glasses ...&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Wed, 20 May 2009 08:41:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422967#M682374</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2009-05-20T08:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422968#M682375</link>
      <description>Well...now i have an AIX error.&lt;BR /&gt;find: 0652-017 -local\( is not a valid option. If i remove "-local" i get an error for " There is a missing conjunction". Please help.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;OSTYPE=`uname -s`&lt;BR /&gt;LOGFILE=/tmp/unowned_file&lt;BR /&gt; &lt;BR /&gt;case $OSTYPE in&lt;BR /&gt;HP-UX) findopt='-xdev \( -nouser -o -nogroup \)' ;;&lt;BR /&gt;AIX) findopt='-local\( -nouser -o -nogroup \' ;;&lt;BR /&gt;*) findopt='\( -nouser -o -nogroup \)' ;;&lt;BR /&gt;esac&lt;BR /&gt; &lt;BR /&gt;find / $findopt -print &amp;gt; ${LOGFILE}&lt;BR /&gt; &lt;BR /&gt;if [ -s $LOGFILE ]; then&lt;BR /&gt;print "MSG: No unowned files found." &lt;BR /&gt;else&lt;BR /&gt;print "MSG: Unowned files found"&lt;BR /&gt;fi &amp;gt;&amp;gt; ${LOGFILE}&lt;BR /&gt; &lt;BR /&gt;exit 0&lt;BR /&gt;</description>
      <pubDate>Wed, 20 May 2009 15:00:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422968#M682375</guid>
      <dc:creator>shell script</dc:creator>
      <dc:date>2009-05-20T15:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422969#M682376</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;The '-local' option isn't valid for AIX.  You might use:&lt;BR /&gt;&lt;BR /&gt;# find / ! -fstype nfs \( -nouser -o -nogroup \)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 20 May 2009 15:52:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422969#M682376</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-20T15:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422970#M682377</link>
      <description>Ok, everything works fine. Lastly i have one error&lt;BR /&gt;Cannot open file /proc/548988.&lt;BR /&gt;&lt;BR /&gt;any ideas on how to include it as well in the find.</description>
      <pubDate>Wed, 20 May 2009 17:16:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422970#M682377</guid>
      <dc:creator>shell script</dc:creator>
      <dc:date>2009-05-20T17:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422971#M682378</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Cannot open file /proc/548988.&lt;BR /&gt;&lt;BR /&gt;The '/proc' filesystem does isn't implemented by HP-UX.  You will find it in AIX and in Linux (of course).&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 20 May 2009 17:19:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422971#M682378</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-20T17:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422972#M682379</link>
      <description>Right i am getting that error on AIX boxes, how do I exclude that filesystem or include it in the find command.</description>
      <pubDate>Wed, 20 May 2009 17:40:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422972#M682379</guid>
      <dc:creator>shell script</dc:creator>
      <dc:date>2009-05-20T17:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422973#M682380</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Right i am getting that error on AIX boxes, how do I exclude that filesystem or include it in the find command.&lt;BR /&gt;&lt;BR /&gt;On AIX I simply redirect STDERR to /dev/null to vanquish the "cannot open" of files in the '/proc' directory:&lt;BR /&gt;&lt;BR /&gt;# find / ! -fstype nfs \( -nouser -o -nogroup \) 2&amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 20 May 2009 17:55:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422973#M682380</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-20T17:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422974#M682381</link>
      <description>Actually i have changed the script a bit. Now i want to have a message displayed if the script does not find any orphan files in the output file like no orphan files found or write to the file if they exist.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;OSTYPE=`uname -s`&lt;BR /&gt;TEMP=/tmp/unowned_file&lt;BR /&gt; &lt;BR /&gt; case $OSTYPE in&lt;BR /&gt; HP-UX)&lt;BR /&gt; find / -xdev \( -type f -o -type d \) \( -nouser -o -nogroup \) &amp;gt; ${TEMP} 2&amp;gt;&amp;amp;1;;&lt;BR /&gt; AIX)&lt;BR /&gt; find / ! -fstype nfs \( -type f -o -type d \) \( -nouser -o -nogroup \) &amp;gt; ${TEMP} 2&amp;gt;&amp;amp;1;;&lt;BR /&gt; *)&lt;BR /&gt; find / -local \( -type f -o -type d \) \( -nouser -o -nogroup \) &amp;gt; ${TEMP} 2&amp;gt;&amp;amp;1;;&lt;BR /&gt; esac&lt;BR /&gt; &lt;BR /&gt; exit 0&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 May 2009 12:59:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422974#M682381</guid>
      <dc:creator>shell script</dc:creator>
      <dc:date>2009-05-21T12:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422975#M682382</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Per you last request:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;set -u&lt;BR /&gt;OSTYPE=`uname -s`&lt;BR /&gt;TEMP=/tmp/unowned_file&lt;BR /&gt;rm -f ${TEMP}&lt;BR /&gt;case $OSTYPE in&lt;BR /&gt;HP-UX)&lt;BR /&gt;find / -xdev \( -type f -o -type d \) \( -nouser -o -nogroup \) &amp;gt; ${TEMP} 2&amp;gt;&amp;amp;1;;&lt;BR /&gt;AIX)&lt;BR /&gt;find / ! -fstype nfs \( -type f -o -type d \) \( -nouser -o -nogroup \) &amp;gt; ${TEMP} 2&amp;gt;&amp;amp;1;;&lt;BR /&gt;*)&lt;BR /&gt;find / -local \( -type f -o -type d \) \( -nouser -o -nogroup \) &amp;gt; ${TEMP} 2&amp;gt;&amp;amp;1;;&lt;BR /&gt;esac&lt;BR /&gt;[ -s ${TEMP} ] &amp;amp;&amp;amp; echo "See '${TEMP} for orphans" || echo "NO orphaned files exist"&lt;BR /&gt;exit 0&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Note that I added 'set -u' to protect things when I do 'rm -f ${TEMP}.&lt;BR /&gt;&lt;BR /&gt;Now, we simply do our 'find()' and examine the output file for a non-zero size.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 21 May 2009 13:12:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422975#M682382</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-21T13:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422976#M682383</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;There is one correction that needs to be made.  You do _not_ want to redirect STDERR to your file since this could give a false positive --- particularly in servers with a '/proc' filesystem as we discussed before.&lt;BR /&gt;&lt;BR /&gt;Instead, use:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;set -u&lt;BR /&gt;OSTYPE=`uname -s`&lt;BR /&gt;TEMP=/tmp/unowned_file&lt;BR /&gt;rm -f ${TEMP}&lt;BR /&gt;case $OSTYPE in&lt;BR /&gt;HP-UX)&lt;BR /&gt;find -xdev \( -type f -o -type d \) \( -nouser -o -nogroup \) &amp;gt; ${TEMP} 2&amp;gt;/dev/null;;&lt;BR /&gt;AIX)&lt;BR /&gt;find / ! -fstype nfs \( -type f -o -type d \) \( -nouser -o -nogroup \) &amp;gt; ${TEMP} 2&amp;gt;/dev/null;;&lt;BR /&gt;*)&lt;BR /&gt;find / -local \( -type f -o -type d \) \( -nouser -o -nogroup \) &amp;gt; ${TEMP} 2&amp;gt;/dev/null;;&lt;BR /&gt;esac&lt;BR /&gt;[ -s ${TEMP} ] &amp;amp;&amp;amp; echo "See '${TEMP}' for orphans" || echo "NO orphaned files exist"&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 21 May 2009 13:22:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422976#M682383</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-21T13:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422977#M682384</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;The echo command is displaying the message on the screen. I want the message to go the file. I do not want any message onscreen. Please advise.&lt;BR /&gt;&lt;BR /&gt;Thanks again.</description>
      <pubDate>Thu, 21 May 2009 13:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422977#M682384</guid>
      <dc:creator>shell script</dc:creator>
      <dc:date>2009-05-21T13:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422978#M682385</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The echo command is displaying the message on the screen. I want the message to go the file. I do not want any message onscreen.&lt;BR /&gt;&lt;BR /&gt;OK, then change the line that tests for a zero-size file to be:&lt;BR /&gt;&lt;BR /&gt;[ -s ${TEMP} ] || echo "NO orphaned files exist" &amp;gt;&amp;gt; ${TEMP}&lt;BR /&gt;&lt;BR /&gt;If there are orphaned files then they will be listed in your ${TEMP} file.  If there are none, the string "NO orphaned file exist" will be present instead.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 21 May 2009 14:11:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422978#M682385</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-21T14:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422979#M682386</link>
      <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;If you always want output written to your file, you could condense things a bit by redirecting STDOUT and STDERR once:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;set -u&lt;BR /&gt;OSTYPE=$(uname -s)&lt;BR /&gt;TEMP=/tmp/unowned_file&lt;BR /&gt;rm   -f ${TEMP}&lt;BR /&gt;exec 1&amp;gt; ${TEMP}&lt;BR /&gt;exec 2&amp;gt; /dev/null&lt;BR /&gt;case $OSTYPE in&lt;BR /&gt;HP-UX)&lt;BR /&gt;    find / -xdev \( -type f -o -type d \) \( -nouser -o -nogroup \)&lt;BR /&gt;;;&lt;BR /&gt;AIX  )&lt;BR /&gt;    find / ! -fstype nfs \( -type f -o -type d \) \( -nouser -o -nogroup \)&lt;BR /&gt;;;&lt;BR /&gt;*    )&lt;BR /&gt;    find / -local \( -type f -o -type d \) \( -nouser -o -nogroup \)&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;[ -s ${TEMP} ] || echo "NO orphaned files exist"&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;...Too, instead of pushing STDERR to '/dev/null' you might want to substitute a file explicitly for errors.&lt;BR /&gt;&lt;BR /&gt;Lastly, I suggest that you change your Forum name to something appropriate --- not "shell script" :-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 21 May 2009 14:35:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-help/m-p/4422979#M682386</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-21T14:35:54Z</dc:date>
    </item>
  </channel>
</rss>

