<?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: kill idle user in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401471#M200895</link>
    <description>thx reply , but I am not familiar with script writing&lt;BR /&gt;&lt;BR /&gt;the bwlow is my script , could suggest how to modify it ? thx&lt;BR /&gt;&lt;BR /&gt;for x in `who -u | awk '{ print $6":"$7 }' | grep -v "\."| awk -F : '{ print&lt;BR /&gt;($1*60)+$2":"$3 }'`&lt;BR /&gt;&lt;BR /&gt;do&lt;BR /&gt;time=`echo $x | awk -F ":" '{ print $1 }'`&lt;BR /&gt;pid=`echo $x | awk -F ":" '{ print $2 }'`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if [[ $time -gt 120 ]]&lt;BR /&gt;then&lt;BR /&gt;kill -1  $pid  &lt;BR /&gt;fi&lt;BR /&gt;done</description>
    <pubDate>Sat, 16 Oct 2004 04:10:15 GMT</pubDate>
    <dc:creator>peterchu</dc:creator>
    <dc:date>2004-10-16T04:10:15Z</dc:date>
    <item>
      <title>kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401466#M200890</link>
      <description>I hv a script to kill the idle user, &lt;BR /&gt;&lt;BR /&gt;for x in ` who -u |awk ........ `&lt;BR /&gt;do &lt;BR /&gt;&lt;BR /&gt;idleuser = ......&lt;BR /&gt;&lt;BR /&gt;if [[ ...... ]] &lt;BR /&gt;then &lt;BR /&gt;kill $idleuser&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;If I want to add a user list so that the user in the list will be be killed by the script , could suggest how to modify the script ? thx.</description>
      <pubDate>Fri, 15 Oct 2004 23:43:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401466#M200890</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-10-15T23:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401467#M200891</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How are you getting the idle user?&lt;BR /&gt;&lt;BR /&gt;To basically read from a file you can use either 'for' or 'while'. There are otherways too. With 'for'&lt;BR /&gt;&lt;BR /&gt;for user in $(cat user_list)&lt;BR /&gt;do&lt;BR /&gt;idleuser=...&lt;BR /&gt;..&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;With 'while'&lt;BR /&gt;&lt;BR /&gt;while read user&lt;BR /&gt;do&lt;BR /&gt;idleuser=...&lt;BR /&gt;...&lt;BR /&gt;done &amp;lt; user_list&lt;BR /&gt;&lt;BR /&gt;The above was assuming that the users are speicified with one user per line.&lt;BR /&gt;&lt;BR /&gt;If you post your complete script, then it will be much easier for us to suggest working solutions.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Sat, 16 Oct 2004 01:13:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401467#M200891</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-10-16T01:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401468#M200892</link>
      <description>Hi &lt;BR /&gt;  I am able to under stand whats is your exact requirement  any how go through the below script&lt;BR /&gt;&lt;BR /&gt;collect all the users inthe system in to file say usrlst&lt;BR /&gt;&lt;BR /&gt; cut -f1 -d : /etc/passwd &amp;gt; usrlst&lt;BR /&gt;&lt;BR /&gt;for i in `cat usrlst`&lt;BR /&gt;do&lt;BR /&gt;ps $i  |cut -f1 -d' ' | fuser -k &lt;BR /&gt;done&lt;BR /&gt;this will kill all the users those logged in the system . .if you want to modify usrlist you can change the users in the list</description>
      <pubDate>Sat, 16 Oct 2004 01:14:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401468#M200892</guid>
      <dc:creator>ramkumar</dc:creator>
      <dc:date>2004-10-16T01:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401469#M200893</link>
      <description>thx replies,&lt;BR /&gt;&lt;BR /&gt;May be I state my requirement more clearly , I want to kill the idle user but ignore to kill some user who are in A/C , EDP and Engineer department , what can I do ? thx.</description>
      <pubDate>Sat, 16 Oct 2004 01:22:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401469#M200893</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-10-16T01:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401470#M200894</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Then you have to somehow identify them by something. Say you add them all to a list say 'excludeusers.list' in the following format.&lt;BR /&gt;&lt;BR /&gt;user1:Finance&lt;BR /&gt;user2:Engineering&lt;BR /&gt;user3:Finance&lt;BR /&gt;user4:Finance&lt;BR /&gt;&lt;BR /&gt;etc.,&lt;BR /&gt;&lt;BR /&gt;Then do the following&lt;BR /&gt;&lt;BR /&gt;for x in `who -u|awk ...` #&amp;lt;-- I assume you are getting the user here"&lt;BR /&gt;do&lt;BR /&gt;grep -q "^${x}:" excludeusers.list&lt;BR /&gt;if [ $? != 0 ]&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt; idleuser="&lt;BR /&gt;..&lt;BR /&gt;..&lt;BR /&gt;if [[ ...... ]]&lt;BR /&gt;then&lt;BR /&gt;kill $idleuser&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Again, unless you post your exact script, these solutions may not work because we don't know how your script is gathering the data.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Sat, 16 Oct 2004 01:54:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401470#M200894</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-10-16T01:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401471#M200895</link>
      <description>thx reply , but I am not familiar with script writing&lt;BR /&gt;&lt;BR /&gt;the bwlow is my script , could suggest how to modify it ? thx&lt;BR /&gt;&lt;BR /&gt;for x in `who -u | awk '{ print $6":"$7 }' | grep -v "\."| awk -F : '{ print&lt;BR /&gt;($1*60)+$2":"$3 }'`&lt;BR /&gt;&lt;BR /&gt;do&lt;BR /&gt;time=`echo $x | awk -F ":" '{ print $1 }'`&lt;BR /&gt;pid=`echo $x | awk -F ":" '{ print $2 }'`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if [[ $time -gt 120 ]]&lt;BR /&gt;then&lt;BR /&gt;kill -1  $pid  &lt;BR /&gt;fi&lt;BR /&gt;done</description>
      <pubDate>Sat, 16 Oct 2004 04:10:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401471#M200895</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-10-16T04:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401472#M200896</link>
      <description>We can do this as,&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;who -u | while read line&lt;BR /&gt;do&lt;BR /&gt;time=`echo $line | grep -v "/." | awk '{ split($6,a,":"); print (a[1]*60)+a[2] }'`&lt;BR /&gt;pid=`echo $line | awk '{ print $7 }'`&lt;BR /&gt;if [[ $time -gt 120 ]]&lt;BR /&gt;then&lt;BR /&gt;  kill -1 $pid&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;It will kill all session's ID with is idle more than 120 seconds there. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 16 Oct 2004 09:23:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401472#M200896</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-16T09:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401473#M200897</link>
      <description>Sorry.&lt;BR /&gt;&lt;BR /&gt; Remove grep -v "/." there and try as&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;set -x&lt;BR /&gt;who -u | while read line&lt;BR /&gt;do&lt;BR /&gt;time=`echo $line | awk '{ split($6,a,":"); print (a[1]*60)+a[2] }'`&lt;BR /&gt;pid=`echo $line | awk '{ print $7 }'`&lt;BR /&gt;if [[ $time -gt 120 ]]&lt;BR /&gt;then&lt;BR /&gt;kill -1 $pid&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;It will work there.</description>
      <pubDate>Sat, 16 Oct 2004 09:28:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401473#M200897</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-16T09:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401474#M200898</link>
      <description>Peter,&lt;BR /&gt;&lt;BR /&gt; We can not use for loop to get a line of words separated with ' ' ( space there ) then it will print word by word there.&lt;BR /&gt;&lt;BR /&gt; Example:&lt;BR /&gt;&lt;BR /&gt;  for x `who -u`&lt;BR /&gt;  do&lt;BR /&gt;    echo $x&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt; It will display word by word.&lt;BR /&gt;&lt;BR /&gt; To do your requirement in one liner then,&lt;BR /&gt;&lt;BR /&gt; kill -1 `who -u | awk '{ if ( $6 != "." ) { split($6,a,":");if ( a[1]*60+a[2]&amp;gt;=120) print $7 } }'`&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Sat, 16 Oct 2004 09:43:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401474#M200898</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-16T09:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401475#M200899</link>
      <description>thx  Muthukumar  reply ,&lt;BR /&gt;&lt;BR /&gt;If I  want  to exclude the users in some department , what can I do ? thx.</description>
      <pubDate>Sat, 16 Oct 2004 10:48:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401475#M200899</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-10-16T10:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401476#M200900</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;There are couple of issues with the script.&lt;BR /&gt;&lt;BR /&gt;1. The activity period in 'who -u' is displayed as 'old' if the inactivity is more than for 24 hrs.&lt;BR /&gt;&lt;BR /&gt;2. Users that were not idle within the last minute will be displayed with a "." in their activity field.&lt;BR /&gt;&lt;BR /&gt;Keeping in view the above, below is an easily understandable script. Create a file say /etc/exception.lst with the following format&lt;BR /&gt;&lt;BR /&gt;user1:Engineering&lt;BR /&gt;user2:Finance&lt;BR /&gt;user3:Finanance&lt;BR /&gt;&lt;BR /&gt;Try it as it is. Once you are satisfied, then remove the comment for the lines that has 'kill_pid' in the last 'if' statement.&lt;BR /&gt;&lt;BR /&gt;-Sri &lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;PATH=$PATH:/usr/bin:/usr/sbin:/usr/contrib/bin&lt;BR /&gt;&lt;BR /&gt;TIMEOUT=120&lt;BR /&gt;EXCEPTIONLIST=/etc/exception.lst&lt;BR /&gt;touch $EXCEPTIONLIST&lt;BR /&gt;&lt;BR /&gt;kill_pid()&lt;BR /&gt;{&lt;BR /&gt;PID=$1&lt;BR /&gt;kill -9 $PID&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;echo "User:Activity:PID:Status"&lt;BR /&gt;who -u | while read line&lt;BR /&gt;do&lt;BR /&gt;time=$(echo $line | awk '{print $6}')&lt;BR /&gt;pid=$(echo $line | awk '{print $7}')&lt;BR /&gt;user=$(echo $line | awk '{print $1}')&lt;BR /&gt;&lt;BR /&gt;grep -q "^${user}:" $EXCEPTIONLIST&lt;BR /&gt;if [ $? != 0 ]&lt;BR /&gt;then&lt;BR /&gt;  if [ "$time" = "old" ]&lt;BR /&gt;  then&lt;BR /&gt;  (( time = $TIMEOUT + 1 ))&lt;BR /&gt;  else&lt;BR /&gt;  echo $time |grep -q "\."&lt;BR /&gt;        if [ $? != 0 ]&lt;BR /&gt;        then&lt;BR /&gt;          time=$(echo $time|awk '{FS=":";print $1*60+$2}')&lt;BR /&gt;        else&lt;BR /&gt;          time=0&lt;BR /&gt;        fi&lt;BR /&gt;  fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if [ $time -gt $TIMEOUT ]&lt;BR /&gt;then&lt;BR /&gt;echo "$user:$time:$pid:Killed"&lt;BR /&gt;#kill_pid $pid&lt;BR /&gt;else&lt;BR /&gt;echo "$user:$time:$pid:Untouched"&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Sat, 16 Oct 2004 20:56:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401476#M200900</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-10-16T20:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401477#M200901</link>
      <description>We can do this as,&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;set -x&lt;BR /&gt;&lt;BR /&gt;# Fill exception user list&lt;BR /&gt;USERLIST="test user peter"&lt;BR /&gt;&lt;BR /&gt;set -A ARR $USERLIST&lt;BR /&gt;&lt;BR /&gt;who -u | while read line&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;user=`echo $line | awk '{ print $1 }'&lt;BR /&gt;time=`echo $line | awk '{ split($6,a,":"); print (a[1]*60)+a[2] }'`&lt;BR /&gt;pid=`echo $line | awk '{ print $7 }'`&lt;BR /&gt;&lt;BR /&gt;index=0&lt;BR /&gt;while [[ $index -lt ${#ARR[*]} ]]&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;  if [[ $user != "${ARR[$index]}" ]]&lt;BR /&gt;  then&lt;BR /&gt;    if [[ $time -gt 120 ]]&lt;BR /&gt;    then&lt;BR /&gt;      kill -1 $pid&lt;BR /&gt;    fi&lt;BR /&gt;  fi&lt;BR /&gt;  &lt;BR /&gt;  let index=index+1  &lt;BR /&gt;  &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Fill the needed user on USERLIST variable there.&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Sun, 17 Oct 2004 05:03:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401477#M200901</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-17T05:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401478#M200902</link>
      <description>hi Muth,&lt;BR /&gt;&lt;BR /&gt;I testing r method , but pop the below message&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;+ USERLIST=test user peter&lt;BR /&gt;+ set -A ARR test user peter&lt;BR /&gt;./ab: line 7: set: -A: invalid option&lt;BR /&gt;set: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]</description>
      <pubDate>Sun, 17 Oct 2004 22:31:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401478#M200902</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-10-17T22:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401479#M200903</link>
      <description>&lt;BR /&gt;Place in users .profile a timeout or&lt;BR /&gt;even in /etc/profile for system wide.&lt;BR /&gt;&lt;BR /&gt;# Exit window on 15 min idle time&lt;BR /&gt;TMOUT=900&lt;BR /&gt;export TMOUT&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Oct 2004 09:19:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401479#M200903</guid>
      <dc:creator>James OReilly</dc:creator>
      <dc:date>2004-10-18T09:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401480#M200904</link>
      <description>Attached is the script I use.&lt;BR /&gt;I have an exception list I look at before killing the user if idle. Idle is over 29 minuts. Over idle at over 39 minutes. And kill when over 59 minutes. Except if the user is on the list. I al so log the idle and kills.&lt;BR /&gt;Been using this for years.&lt;BR /&gt;&lt;BR /&gt;idle_exception.list contains userID folloewd by a + sign like "metm+"&lt;BR /&gt;&lt;BR /&gt;This may help you.&lt;BR /&gt;Marty</description>
      <pubDate>Mon, 18 Oct 2004 09:57:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401480#M200904</guid>
      <dc:creator>Marty Metras</dc:creator>
      <dc:date>2004-10-18T09:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401481#M200905</link>
      <description>thx reply , &lt;BR /&gt;&lt;BR /&gt;I hv tried Sridhar Bhaskarla 's script ,&lt;BR /&gt;&lt;BR /&gt;but have the below error when run it , could suggest how can I modify it ? thx.</description>
      <pubDate>Tue, 19 Oct 2004 08:16:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401481#M200905</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-10-19T08:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401482#M200906</link>
      <description>Olypian missed to complete while do done there.&lt;BR /&gt;&lt;BR /&gt;Try that as,&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;PATH=$PATH:/usr/bin:/usr/sbin:/usr/contrib/bin&lt;BR /&gt;&lt;BR /&gt;TIMEOUT=120&lt;BR /&gt;EXCEPTIONLIST=/etc/exception.lst&lt;BR /&gt;touch $EXCEPTIONLIST&lt;BR /&gt;&lt;BR /&gt;kill_pid()&lt;BR /&gt;{&lt;BR /&gt;PID=$1&lt;BR /&gt;kill -9 $PID&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;echo "User:Activity:PID:Status"&lt;BR /&gt;who -u | while read line&lt;BR /&gt;do&lt;BR /&gt;time=$(echo $line | awk '{print $6}')&lt;BR /&gt;pid=$(echo $line | awk '{print $7}')&lt;BR /&gt;user=$(echo $line | awk '{print $1}')&lt;BR /&gt;&lt;BR /&gt;grep -q "^${user}:" $EXCEPTIONLIST&lt;BR /&gt;if [ $? != 0 ]&lt;BR /&gt;then&lt;BR /&gt;if [ "$time" = "old" ]&lt;BR /&gt;then&lt;BR /&gt;(( time = $TIMEOUT + 1 ))&lt;BR /&gt;else&lt;BR /&gt;echo $time |grep -q "\."&lt;BR /&gt;if [ $? != 0 ]&lt;BR /&gt;then&lt;BR /&gt;time=$(echo $time|awk '{FS=":";print $1*60+$2}')&lt;BR /&gt;else&lt;BR /&gt;time=0&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if [ $time -gt $TIMEOUT ]&lt;BR /&gt;then&lt;BR /&gt;echo "$user:$time:$pid:Killed"&lt;BR /&gt;&lt;BR /&gt;# Uncomment to do kill that PID&lt;BR /&gt;#kill_pid $pid&lt;BR /&gt;else&lt;BR /&gt;echo "$user:$time:$pid:Untouched"&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Muthu.&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Oct 2004 09:01:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401482#M200906</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-19T09:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401483#M200907</link>
      <description>Sorry sridhar, I missed m on Olympian there. :((. &lt;BR /&gt;&lt;BR /&gt; Peter, &lt;BR /&gt;&lt;BR /&gt;  I have assigned points to   514  of   619  responses to  my questions. Assign else more there. ;)&lt;BR /&gt;&lt;BR /&gt;  PS: 0 points to this.</description>
      <pubDate>Tue, 19 Oct 2004 09:20:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401483#M200907</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-19T09:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401484#M200908</link>
      <description>thx Muthukumar , &lt;BR /&gt;&lt;BR /&gt;I tried your script , it work fine at UNIX system , it fully meet the requirement , however , I also want to run it at linux , if I run it at RH linux , it will kill all the users right now ( even the user is processing sth ) , could suggest how can make it to make at linux ? thx.</description>
      <pubDate>Fri, 22 Oct 2004 21:06:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401484#M200908</guid>
      <dc:creator>peterchu</dc:creator>
      <dc:date>2004-10-22T21:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: kill idle user</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401485#M200909</link>
      <description>Peter,&lt;BR /&gt;&lt;BR /&gt; Use this script to on RH Linux versions. IT is working.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# RH Linux idle user kill&lt;BR /&gt;&lt;BR /&gt;# PATH&lt;BR /&gt;PATH=$PATH:/bin:/usr/bin:/usr/sbin:/usr/contrib/bin&lt;BR /&gt;&lt;BR /&gt;TIMEOUT=120&lt;BR /&gt;EXCEPTIONLIST=./exception.lst&lt;BR /&gt;&lt;BR /&gt;touch $EXCEPTIONLIST&lt;BR /&gt;&lt;BR /&gt;if [[ ! -s $EXCEPTIONLIST ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "$EXCEPTIONLIST File is available with no users to avoid killing"&lt;BR /&gt;fi  &lt;BR /&gt;&lt;BR /&gt;kill_pid()&lt;BR /&gt;{&lt;BR /&gt;PID=$1&lt;BR /&gt;kill -9 $PID&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;echo "User:Activity:PID:Status"&lt;BR /&gt;who -u | while read line&lt;BR /&gt;do&lt;BR /&gt;time=$(echo $line | awk '{print $6}')&lt;BR /&gt;pid=$(echo $line | awk '{print $7}')&lt;BR /&gt;user=$(echo $line | awk '{print $1}')&lt;BR /&gt;&lt;BR /&gt;grep -q "^${user}:" $EXCEPTIONLIST&lt;BR /&gt;if [ $? != 0 ]&lt;BR /&gt;then&lt;BR /&gt;if [ "$time" = "old" ]&lt;BR /&gt;then&lt;BR /&gt;(( time = $TIMEOUT + 1 ))&lt;BR /&gt;else&lt;BR /&gt;echo $time |grep -q "\."&lt;BR /&gt;if [ $? != 0 ]&lt;BR /&gt;then&lt;BR /&gt;time=$(echo $time|awk '{FS=":";print $1*60+$2}')&lt;BR /&gt;else&lt;BR /&gt;time=0&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [ $time -gt $TIMEOUT ]&lt;BR /&gt;then&lt;BR /&gt;echo "$user:$time:$pid:Killed"&lt;BR /&gt;&lt;BR /&gt;# Uncomment to do kill that PID&lt;BR /&gt;#kill_pid $pid&lt;BR /&gt;else&lt;BR /&gt;echo "$user:$time:$pid:Untouched"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;# Normal exit&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;###&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;BR /&gt;</description>
      <pubDate>Sun, 24 Oct 2004 22:54:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-idle-user/m-p/3401485#M200909</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-24T22:54:27Z</dc:date>
    </item>
  </channel>
</rss>

