<HTML>
<HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="OPENWEBMAIL" name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<font size="2">Hola lista como andan ? tanto tiempo.... tengo un problemita y me gustaria saber su opinion...
<br />
<br />tengo en uno de mis server linux corriendo sistemas bajo cobol, y hay algunos usuarios que quedan con la sesion colgada entonces hay que matarlos de forma manual por el PID, para hacerlo mejor hice un pequeño script pero nose porque hay veces que funciona y otras veces no.... este es el codigo, si me dan una mano bien agradecido estare.
<br />
<br />#!/usr/bin/perl
<br />
<br />print "Introduzca nombre de usuario :";
<br />$user = <STDIN>;
<br />
<br />system("ps auxw | grep $user | awk '{print $2}' > matar.txt");
<br />
<br />open(PID, "< matar.txt");
<br />@matar =<PID>;
<br />
<br /> foreach $amatar (@matar){
<br /> system("kill -9 $amatar");
<br /> }
<br />
<br />close (PID);
<br />
<br />
<br />-------------------------------------
<br />
Ariel E. Pedrozo
<br />
DBA & Network Administrator
<br />
Coop. Cabal LTDA
<br />
Ed. Ahorros Paraguayos 5to. Piso
<br />
Tel: 453009 int. 195
<br />
Mov: 0971 730744
<br />
Asuncio -
Paraguay
<br />
</font>
</BODY>
</HTML>