<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Courier New, Courier, monospace">When I ran "H - Bob
      Stockler's lockinfo script", it was giving me filepro as the user
      who had a record locked.<br>
      By making the following change, I got the actual user name on the
      TTY.<br>
      <br>
      snipet:<br>
      <br>
      &nbsp;&nbsp; # Get the user names, ttys and commands being executed:<br>
      &nbsp;&nbsp; for i in $I<br>
      &nbsp;&nbsp; do # Get user name, tty &amp; command for the process holding
      the lock:<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eval $( $PS -ef |<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $AWK -v PID="${PID[i]}" '<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $2 == PID { print "USER=" $1 ; print "TTY=" $6<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $1 = $2 = $3 = $4 = $5 = $6 = $7 = "" ;
      sub(/^[ \t]+/,"")<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "CMD=\"" $0 "\"" }' )<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Print the results:<br>
      <font color="#cc0000"><b>USER_NEW=`w | grep pts/0 | awk '{print
          $1}'`</b></font><br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ECHO "<br>
      &nbsp;&nbsp; filePro File: $PFNAME<br>
      &nbsp; Record Number: ${REC_NUM[i]}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User: <font color="#cc0000"><b>$USER_NEW</b></font><br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TTY: $TTY<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PID: ${PID[i]}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Command: $CMD"<br>
      &nbsp;&nbsp;&nbsp;&nbsp; [[ $PROMPT = 1 ]] &amp;&amp; PE<br>
      <br>
      The use of ps -ef does not give the actual user. <br>
      i.e. <br>
      filepro&nbsp;&nbsp; 7175&nbsp; 7172&nbsp; 0 11:01 pts/0&nbsp;&nbsp;&nbsp; 00:00:00 /appl/fp/dclerk<br>
      <br>
      But if you use w and grep for the tty you get the actual user. <br>
      i.e.<br>
      richard&nbsp;&nbsp;&nbsp;&nbsp; pts/0&nbsp;&nbsp;&nbsp; 99-101-38-43.lig 10:42&nbsp;&nbsp; 24:25&nbsp;&nbsp; 0.17s&nbsp; 0.00s
      /appl/fp/runmenu<br>
      <br>
      <br>
      Also, you could add:<br>
      idle time for that user:</font><font face="Courier New, Courier,
      monospace"><font color="#cc0000"><b> USER_IDLE=`w | grep pts/0 |
          awk '{print $5}'`</b></font></font><br>
    <font face="Courier New, Courier, monospace">user's ip connect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      : </font><font face="Courier New, Courier, monospace"><font
        color="#cc0000"><b>USER_IP=`w | grep pts/0 | awk '{print $3}'`</b></font></font><br>
    <font face="Courier New, Courier, monospace"><br>
      Then insert, User Idle: $USER_IDLE and $USER_IP, just below User:
      $USER_NEW<br>
    </font><font face="Courier New, Courier, monospace"><br>
      I hope this is helpful,<br>
      <br>
      Richard D. Williams<br>
      <br>
    </font><br>
    <br>
  </body>
</html>