<?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 scripts in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2518714#M868039</link>
    <description>You would be better posting this query in the HP-UX forum as this forum  is meant for hardware queries.</description>
    <pubDate>Thu, 19 Apr 2001 06:14:39 GMT</pubDate>
    <dc:creator>melvyn burnard</dc:creator>
    <dc:date>2001-04-19T06:14:39Z</dc:date>
    <item>
      <title>Shell scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2518713#M868038</link>
      <description>Hi Experts&lt;BR /&gt;          I am trying to write a script which calculates the difference between the two dates and gives it as the number of days say for Eg: between today 4/18/01 and 3/18/01 its 30 days.&lt;BR /&gt;               My aim is to monitor the last login time of a user and compare it with the system date and in case its more than 60 days I want to send a alert saying user has been idle. My client runs a NIS environment and he doesnt havee trusted systems.  I have tried writing the following script below, can you pl guide me and let me know if its the correct way?&lt;BR /&gt;&lt;BR /&gt;Thnks in advance&lt;BR /&gt;Shiv&lt;BR /&gt;_______________________________________________&lt;BR /&gt;&lt;BR /&gt;#! /bin/sh &lt;BR /&gt;OL=`TZ=PST+1440 date +%m%d` &lt;BR /&gt;TO=`date +%m%d` &lt;BR /&gt;LST=`last -1 karin | awk '{print $6}'` &lt;BR /&gt;MON=`last -1 karin | awk '{print $5}'` &lt;BR /&gt;case $MON in &lt;BR /&gt;       Jan) MO=01;; &lt;BR /&gt;       Feb) MO=02;; &lt;BR /&gt;       Mar) MO=03;; &lt;BR /&gt;       Apr) MO=04;; &lt;BR /&gt;       May) MO=05;; &lt;BR /&gt;       Jun) MO=06;; &lt;BR /&gt;       Jul) MO=07;; &lt;BR /&gt;esac &lt;BR /&gt;CK=$MO$LST &lt;BR /&gt;echo Last Login Date $CK &lt;BR /&gt;if [ $OL -lt $MO ] &lt;BR /&gt;       then &lt;BR /&gt;               echo This user has not loged last 60 days; &lt;BR /&gt;               echo This user has to be deleted ; &lt;BR /&gt;       else &lt;BR /&gt;               echo User logged within 60 days; &lt;BR /&gt;fi &lt;BR /&gt;</description>
      <pubDate>Thu, 19 Apr 2001 02:16:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2518713#M868038</guid>
      <dc:creator>ShivKumar_1</dc:creator>
      <dc:date>2001-04-19T02:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2518714#M868039</link>
      <description>You would be better posting this query in the HP-UX forum as this forum  is meant for hardware queries.</description>
      <pubDate>Thu, 19 Apr 2001 06:14:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2518714#M868039</guid>
      <dc:creator>melvyn burnard</dc:creator>
      <dc:date>2001-04-19T06:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2518715#M868040</link>
      <description>See &lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x9ba3ee3e323bd5118fef0090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x9ba3ee3e323bd5118fef0090279cd0f9,00.html&lt;/A&gt;</description>
      <pubDate>Thu, 17 May 2001 07:06:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts/m-p/2518715#M868040</guid>
      <dc:creator>Vincenzo Restuccia</dc:creator>
      <dc:date>2001-05-17T07:06:19Z</dc:date>
    </item>
  </channel>
</rss>

