riccardinofuffolo

Sistemi Operativi - 07/11/2005 - B6

Sep 12th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.34 KB | None | 0 0
  1. #!/bin/bash
  2. #{ } [ ]
  3.  
  4. filename="vairus.dat"
  5. while read linea
  6. do
  7.     ps -ef | awk -v infetti=$linea '{
  8.         if ($8 == infetti) {
  9.             print $1 " " $2
  10.         }
  11.     }' | awk '{
  12.         cmd="ps -ef"
  13.         print $1 " "
  14.         while( cmd | getline linea > 0) {
  15.             split(linea,vettore)
  16.             if( $2 == vettore[3]) {
  17.                 print vettore[2]   
  18.             }
  19.         }
  20.     }'
  21. done < $filename
Advertisement
Add Comment
Please, Sign In to add comment