<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">While I was fooling
around with this script I made a few changes I think some will
like.<br>
<br>
# Get the user names, ttys and commands being executed:<br>
<b><font color="#cc0000">clear<br>
$ECHO "<br>
Filepro File Record User TTY PID Idle IP"</font><br>
</b><br>
for i in $I<br>
do # Get user name, tty & command for the process holding
the lock:<br>
eval $( $PS -ef |<br>
$AWK -v PID="${PID[i]}" '<br>
$2 == PID { print "USER=" $1 ; print "TTY=" $6<br>
$1 = $2 = $3 = $4 = $5 = $6 = $7 = "" ;
sub(/^[ \t]+/,"")<br>
print "CMD=\"" $0 "\"" }' )<br>
# Print the results:<br>
<b><font color="#cc0000">USER_NEW=`w | grep pts/0 | awk '{print
$1}'`;<br>
USER_IDLE=`w | grep pts/0 | awk '{print $5}'`;<br>
USER_IP=`w | grep pts/0 | awk '{print $3}'`;<br>
$ECHO "$PFNAME ${REC_NUM[i]} $USER_NEW $TTY
${PID[i]} $USER_IDLE $USER_IP";</font><br>
</b><font color="#009900"><b>#original code commented out</b><br>
#$ECHO "<br>
#filePro File: $PFNAME<br>
#Record Number: ${REC_NUM[i]}<br>
#User: $USER_NEW Idle: $USER_IDLE IP: $USER_IP<br>
#TTY: $TTY<br>
#PID: ${PID[i]}<br>
#Command: $CMD";/usr/local/bin/pause</font><br>
[[ $PROMPT = 1 ]] && PE<br>
done<br>
done<br>
<br>
This is what these changes will yield:<br>
<br>
</font><font face="Courier New, Courier, monospace">Filepro File
Record User TTY PID Idle IP<br>
wip_web 853204 dbrinkev ? 24385 3days
user-387o84p.cab<br>
<br>
Press Enter to continue:</font><br>
</body>
</html>