<?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 with shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468554#M774816</link>
    <description>Hi,&lt;BR /&gt;What about the command last?&lt;BR /&gt;&lt;BR /&gt;Just thoughts&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Victor</description>
    <pubDate>Wed, 29 Nov 2000 16:29:59 GMT</pubDate>
    <dc:creator>Victor BERRIDGE</dc:creator>
    <dc:date>2000-11-29T16:29:59Z</dc:date>
    <item>
      <title>Help with shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468553#M774815</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I need to write a program using the DATE and WHO commands that prints the number of hours and minutes that a user has been logged on to the system ( assume that this is less that 24 hours. &lt;BR /&gt;&lt;BR /&gt;Your help will be greatly appreciated!!!</description>
      <pubDate>Wed, 29 Nov 2000 16:23:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468553#M774815</guid>
      <dc:creator>sanman_2</dc:creator>
      <dc:date>2000-11-29T16:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help with shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468554#M774816</link>
      <description>Hi,&lt;BR /&gt;What about the command last?&lt;BR /&gt;&lt;BR /&gt;Just thoughts&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Victor</description>
      <pubDate>Wed, 29 Nov 2000 16:29:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468554#M774816</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2000-11-29T16:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468555#M774817</link>
      <description>Why don't you just do a grep on the wtmp file. Something like:&lt;BR /&gt;&lt;BR /&gt;last | grep &lt;USER&gt;&lt;BR /&gt;&lt;BR /&gt;will show you the user when they logged in and how long they have been on...&lt;BR /&gt;&lt;BR /&gt;rcw&lt;/USER&gt;</description>
      <pubDate>Wed, 29 Nov 2000 16:30:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468555#M774817</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2000-11-29T16:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468556#M774818</link>
      <description>I do not want to write a script for you. But, log in as root and try 'last -1 &lt;USER&gt;'. Maybe, that's what you need.&lt;BR /&gt;&lt;/USER&gt;</description>
      <pubDate>Wed, 29 Nov 2000 16:32:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468556#M774818</guid>
      <dc:creator>Thomas Schler_1</dc:creator>
      <dc:date>2000-11-29T16:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468557#M774819</link>
      <description>The last command will provide the info you are looking for. For the time, awk the field that contains the amount of time logged in</description>
      <pubDate>Wed, 29 Nov 2000 16:34:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468557#M774819</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2000-11-29T16:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468558#M774820</link>
      <description>here my script&lt;BR /&gt;&lt;BR /&gt;who |awk  -vh=`date +%H` -vm=`date +%M` '{&lt;BR /&gt;split($NF, a, ":")&lt;BR /&gt;sh=a[1];&lt;BR /&gt;sm=a[2];&lt;BR /&gt;dm=h*60+m-a[1]*60-a[2];&lt;BR /&gt;hh=int(dm/60);&lt;BR /&gt;mm=dm-hh*60;&lt;BR /&gt;printf("%s : %d hours %d min\n", $1, hh, mm);&lt;BR /&gt;}'</description>
      <pubDate>Wed, 29 Nov 2000 16:39:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468558#M774820</guid>
      <dc:creator>Rainer_1</dc:creator>
      <dc:date>2000-11-29T16:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468559#M774821</link>
      <description>Just a quick command.&lt;BR /&gt;Hope this will lead you to the better output.&lt;BR /&gt;&lt;BR /&gt;first run &lt;BR /&gt;/etc/last -R &lt;BR /&gt;Then filter out which information you want.&lt;BR /&gt;/etc/last -R|awk '{print $1, $3, $7, $8, $9, $10}'&lt;BR /&gt;This will display user-id, hostname or ip-address, time.&lt;BR /&gt;&lt;BR /&gt;Check "man awk" for further details</description>
      <pubDate>Wed, 29 Nov 2000 17:03:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-with-shell-script/m-p/2468559#M774821</guid>
      <dc:creator>Darrel Louis</dc:creator>
      <dc:date>2000-11-29T17:03:16Z</dc:date>
    </item>
  </channel>
</rss>

