<?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: Need a Script help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627246#M236901</link>
    <description>George,&lt;BR /&gt;&lt;BR /&gt;You could try the following.&lt;BR /&gt;&lt;BR /&gt;NOTE: I don't have AIX machine. was not tested.&lt;BR /&gt;&lt;BR /&gt;##################################################################################################&lt;BR /&gt;find_all_suid_FILES()&lt;BR /&gt;{&lt;BR /&gt;OSTYPE=`uname -s`&lt;BR /&gt;if [ ${OSTYPE} = "HP-UX" -o ${OSTYPE} = "AIX" ]&lt;BR /&gt;then&lt;BR /&gt;   find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -dl {} \; | \&lt;BR /&gt;   sort -k 3,3 -k 9,9 -k 4,4 &amp;gt; ${WORK_FILE} # Sort by user, group, and file&lt;BR /&gt;      elif [ ${OSTYPE} = "AIX" ]&lt;BR /&gt;then&lt;BR /&gt;   find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -dl {} \; | \&lt;BR /&gt;   sort -k 3,3 -k 9,9 -k 4,4 | grep -v /proc &amp;gt; ${WORK_FILE} # Sort by user, group, and file&lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;#################################################################################################&lt;BR /&gt;&lt;BR /&gt;-Junior</description>
    <pubDate>Thu, 15 Sep 2005 15:10:37 GMT</pubDate>
    <dc:creator>J. Callender</dc:creator>
    <dc:date>2005-09-15T15:10:37Z</dc:date>
    <item>
      <title>Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627237#M236892</link>
      <description>Hello Gurus,&lt;BR /&gt;&lt;BR /&gt;I inherited a script that runs on all the unix servers. It checks for suid changes and sends a report.&lt;BR /&gt;&lt;BR /&gt;Now on AIX servers i want to EXCLUDE the /proc directory. &lt;BR /&gt;&lt;BR /&gt;So if the server is AIX exclude /Proc. &lt;BR /&gt;&lt;BR /&gt;Can you please suggest what modification needs to be done?..Attached is the existing script&lt;BR /&gt;&lt;BR /&gt;Any help will be welcome&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;George</description>
      <pubDate>Thu, 15 Sep 2005 12:41:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627237#M236892</guid>
      <dc:creator>George Abraham_3</dc:creator>
      <dc:date>2005-09-15T12:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627238#M236893</link>
      <description>Change the find command.  It starts with /:&lt;BR /&gt;&lt;BR /&gt;find / &lt;BR /&gt;&lt;BR /&gt;Change it to a list of all the mounted file systems except /Proc:&lt;BR /&gt;&lt;BR /&gt;find /usr /etc /home /var&lt;BR /&gt;&lt;BR /&gt;and so on.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 15 Sep 2005 12:53:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627238#M236893</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-09-15T12:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627239#M236894</link>
      <description>&lt;BR /&gt;I would like to check if OS=AIX then just exclude /proc.&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;George</description>
      <pubDate>Thu, 15 Sep 2005 12:55:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627239#M236894</guid>
      <dc:creator>George Abraham_3</dc:creator>
      <dc:date>2005-09-15T12:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627240#M236895</link>
      <description>You could do a condition handler that determines which set of directories to work against based on the output of a uname -a.  You could use an if/then or possibly a case statement.&lt;BR /&gt;&lt;BR /&gt;No time for coding examples right now. If I get time later, I can work on it.  Someone else will probably have an example for you though.</description>
      <pubDate>Thu, 15 Sep 2005 12:58:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627240#M236895</guid>
      <dc:creator>Pat Lieberg</dc:creator>
      <dc:date>2005-09-15T12:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627241#M236896</link>
      <description>OSTYPE=$(uname -s)&lt;BR /&gt;&lt;BR /&gt;this will give you HPUX output (in capital letters) if executed on an hpux system. Run it on AIX machine and see what it generates and construct an "if" logic around the strings after your case statement block is executed.&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Sep 2005 13:02:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627241#M236896</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-09-15T13:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627242#M236897</link>
      <description>in your find command lind before you |sort, yoyu could do a |grep -v '^/proc/'  That would remove all files and directories under the /proc filesystem</description>
      <pubDate>Thu, 15 Sep 2005 13:03:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627242#M236897</guid>
      <dc:creator>Alan Meyer_4</dc:creator>
      <dc:date>2005-09-15T13:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627243#M236898</link>
      <description>I just remembered that I had an old, junky AIX box in one corner of mydata center and the command's output is AIX in capital letters as well.</description>
      <pubDate>Thu, 15 Sep 2005 13:03:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627243#M236898</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-09-15T13:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627244#M236899</link>
      <description>use my above grep suggestion in conjunction with the other commanets about determining the OS = AIX</description>
      <pubDate>Thu, 15 Sep 2005 13:04:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627244#M236899</guid>
      <dc:creator>Alan Meyer_4</dc:creator>
      <dc:date>2005-09-15T13:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627245#M236900</link>
      <description>Hi George:&lt;BR /&gt;&lt;BR /&gt;Use find()s '-prune'.  Consider a case where you would want to find all files named "core*" [without being careful of what was returned :-)) ] and want to do that from the root directory, for every mountpoint there under, *except* /usr.&lt;BR /&gt;&lt;BR /&gt;This syntax works on HP-UX or AIX so you can adapt it to your needs.  In fact, since HP-UX doesn't have a /proc directory you can probably unconditionally factor this into your 'find' command regardless of the OS.&lt;BR /&gt;&lt;BR /&gt;By example:&lt;BR /&gt;&lt;BR /&gt;# find / -name usr -prune -o \( -type f -a -name "core*" -a -print \)&lt;BR /&gt;&lt;BR /&gt;...this returns all files named "core*" from all directories *except* 'usr'.  &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 15 Sep 2005 14:34:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627245#M236900</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-09-15T14:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627246#M236901</link>
      <description>George,&lt;BR /&gt;&lt;BR /&gt;You could try the following.&lt;BR /&gt;&lt;BR /&gt;NOTE: I don't have AIX machine. was not tested.&lt;BR /&gt;&lt;BR /&gt;##################################################################################################&lt;BR /&gt;find_all_suid_FILES()&lt;BR /&gt;{&lt;BR /&gt;OSTYPE=`uname -s`&lt;BR /&gt;if [ ${OSTYPE} = "HP-UX" -o ${OSTYPE} = "AIX" ]&lt;BR /&gt;then&lt;BR /&gt;   find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -dl {} \; | \&lt;BR /&gt;   sort -k 3,3 -k 9,9 -k 4,4 &amp;gt; ${WORK_FILE} # Sort by user, group, and file&lt;BR /&gt;      elif [ ${OSTYPE} = "AIX" ]&lt;BR /&gt;then&lt;BR /&gt;   find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -dl {} \; | \&lt;BR /&gt;   sort -k 3,3 -k 9,9 -k 4,4 | grep -v /proc &amp;gt; ${WORK_FILE} # Sort by user, group, and file&lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;#################################################################################################&lt;BR /&gt;&lt;BR /&gt;-Junior</description>
      <pubDate>Thu, 15 Sep 2005 15:10:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627246#M236901</guid>
      <dc:creator>J. Callender</dc:creator>
      <dc:date>2005-09-15T15:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627247#M236902</link>
      <description>Tested on AIX 5.2 with Junior's modification. Works  good. &lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Thu, 15 Sep 2005 23:46:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627247#M236902</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-09-15T23:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627248#M236903</link>
      <description>Just change this code as,&lt;BR /&gt;&lt;BR /&gt;find_all_suid_FILES()&lt;BR /&gt;{&lt;BR /&gt;OSTYPE=`uname -s`&lt;BR /&gt;if [ ${OSTYPE} = "HP-UX"]&lt;BR /&gt;then&lt;BR /&gt;find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -dl {} \; | \&lt;BR /&gt;sort -k 3,3 -k 9,9 -k 4,4 &amp;gt; ${WORK_FILE} # Sort by user, group, and file&lt;BR /&gt;elif [ ${OSTYPE} = "AIX" ]&lt;BR /&gt;then&lt;BR /&gt;cd /&lt;BR /&gt;for fdir in `ls`&lt;BR /&gt;do&lt;BR /&gt;  if [ $fdir != proc ]&lt;BR /&gt;  then&lt;BR /&gt;    find $fdir -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -dl {} \; | \&lt;BR /&gt;sort -k 3,3 -k 9,9 -k 4,4 | grep -v /proc &amp;gt; ${WORK_FILE} # Sort by user, group, and file&lt;BR /&gt;   fi&lt;BR /&gt;done&lt;BR /&gt;fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;To skip /proc directory when OS is AIX.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Fri, 16 Sep 2005 00:17:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627248#M236903</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-16T00:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627249#M236904</link>
      <description>Thanks to all who have helped&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Geroge Abraham</description>
      <pubDate>Fri, 16 Sep 2005 13:02:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-a-script-help/m-p/3627249#M236904</guid>
      <dc:creator>George Abraham_3</dc:creator>
      <dc:date>2005-09-16T13:02:38Z</dc:date>
    </item>
  </channel>
</rss>

