<?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 Please Help with small Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/please-help-with-small-script/m-p/3360448#M193967</link>
    <description>Can someone please help me with something real basic?  I don't have much experience with scripting.  I need to determine whether some files exist on the systems or not and have all of the results write out to a file named 29_XXXXXXXX.    &lt;BR /&gt;&lt;BR /&gt;I am stumped and this is how far I've gotten.&lt;BR /&gt;&lt;BR /&gt;Thanks - Angie&lt;BR /&gt;&lt;BR /&gt;echo "Item #29 -- Determine if various log files exist."&lt;BR /&gt;      &lt;BR /&gt;  if [ ! -d /etc/wtmpx]; then&lt;BR /&gt;  echo wtmpx file doesn't exist &amp;gt; 29_wtmpx&lt;BR /&gt;  #  /etc/utmpx \&lt;BR /&gt;  #  /var/adm/utmpx \&lt;BR /&gt;  #  /var/adm/loginlog \&lt;BR /&gt;  #  /var/adm/sulog \&lt;BR /&gt;  #  /var/adm/messages \&lt;BR /&gt;  #  /var/cron/log \&lt;BR /&gt;  #  /var/log/syslog \&lt;BR /&gt;</description>
    <pubDate>Wed, 18 Aug 2004 18:19:20 GMT</pubDate>
    <dc:creator>Angie_1</dc:creator>
    <dc:date>2004-08-18T18:19:20Z</dc:date>
    <item>
      <title>Please Help with small Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/please-help-with-small-script/m-p/3360448#M193967</link>
      <description>Can someone please help me with something real basic?  I don't have much experience with scripting.  I need to determine whether some files exist on the systems or not and have all of the results write out to a file named 29_XXXXXXXX.    &lt;BR /&gt;&lt;BR /&gt;I am stumped and this is how far I've gotten.&lt;BR /&gt;&lt;BR /&gt;Thanks - Angie&lt;BR /&gt;&lt;BR /&gt;echo "Item #29 -- Determine if various log files exist."&lt;BR /&gt;      &lt;BR /&gt;  if [ ! -d /etc/wtmpx]; then&lt;BR /&gt;  echo wtmpx file doesn't exist &amp;gt; 29_wtmpx&lt;BR /&gt;  #  /etc/utmpx \&lt;BR /&gt;  #  /var/adm/utmpx \&lt;BR /&gt;  #  /var/adm/loginlog \&lt;BR /&gt;  #  /var/adm/sulog \&lt;BR /&gt;  #  /var/adm/messages \&lt;BR /&gt;  #  /var/cron/log \&lt;BR /&gt;  #  /var/log/syslog \&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Aug 2004 18:19:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/please-help-with-small-script/m-p/3360448#M193967</guid>
      <dc:creator>Angie_1</dc:creator>
      <dc:date>2004-08-18T18:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Please Help with small Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/please-help-with-small-script/m-p/3360449#M193968</link>
      <description>With scrpting, you can do the same thing in umpteen differen ways :-)&lt;BR /&gt;&lt;BR /&gt;Here is the one version &lt;BR /&gt;&lt;BR /&gt;1) Create a file that lists all the log files that you would like to check for&lt;BR /&gt;&lt;BR /&gt;  # vi /usr/local/bin/LOGFLLIST&lt;BR /&gt;  /etc/utmpx &lt;BR /&gt;  /var/adm/utmpx &lt;BR /&gt;  /var/adm/loginlog &lt;BR /&gt;  /var/adm/sulog &lt;BR /&gt;  /var/adm/messages &lt;BR /&gt;  /var/cron/log &lt;BR /&gt;  /var/log/syslog &lt;BR /&gt;  #&lt;BR /&gt; &lt;BR /&gt;2) Now the script&lt;BR /&gt;&lt;BR /&gt; # vi /usr/local/bin/script&lt;BR /&gt; LIST=/usr/local/bin/LOGFLLIST&lt;BR /&gt; OUTLOG=/usr/local/bin/29_output  &lt;BR /&gt;  &lt;BR /&gt; echo "Item #29 -- Determine if various log files exist."&lt;BR /&gt;&lt;BR /&gt; for FILE in $(cat ${LIST})&lt;BR /&gt; do&lt;BR /&gt;   if [[ -f $FILE ]]&lt;BR /&gt;   then&lt;BR /&gt;     echo "Log file ${FILE} exists !" &amp;gt;&amp;gt; $OUTLOG&lt;BR /&gt;   else&lt;BR /&gt;     echo "ERROR: Log file ${FILE} doesnt exists !" &amp;gt;&amp;gt; $OUTLOG&lt;BR /&gt;   fi&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;-- Sundar  &lt;BR /&gt;</description>
      <pubDate>Wed, 18 Aug 2004 18:33:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/please-help-with-small-script/m-p/3360449#M193968</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-08-18T18:33:15Z</dc:date>
    </item>
  </channel>
</rss>

