Advertisement
cinnamonandrew

Pb5 SHELL

Apr 14th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.27 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. names=$*
  4.  
  5. echo $names
  6.  
  7. for i in $names; do
  8.         cmd=`ps -C "$i" | tail -n +2 | awk '{print $1}'`
  9.  
  10.         if [ -n "$cmd" ]; then
  11.                 #kill $cmd
  12.                 echo $i killed
  13.         else
  14.                 echo $i not found
  15.         fi
  16. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement