Advertisement
v1ral_ITS

The Needed killps Script For The Below Easy apt Shell Script

Jul 13th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.85 KB | None | 0 0
  1. #!/bin/bash
  2. # Author : v1ral_ITS
  3. process=`ps -u $USER | zenity --list --column "Please select a process to kill:" --text="List all $USER processes:" --width 450 --height 570`
  4.  
  5. ans=`echo $?`
  6.  
  7.     if test "$ans" -eq "0" ;
  8.     then
  9.  
  10.         select=`echo $process | cut -d" " -f1`
  11.  
  12.         kill $select
  13.             ans1=`echo $?`
  14.             if [ "$ans1" == "0" ] ;
  15.             then
  16.             select1=`echo $process | cut -d":" -f3  | cut -d" " -f2`
  17.             echo | zenity --info --text="Process '$select1' with pid '$select' was killed!" --width 400 --height 150
  18.             else
  19.             echo | zenity --error --text="Process '$select1' with pid '$select' not found!" --width 200 --height 100
  20.             fi
  21.     exit 0
  22.     fi
  23.  
  24.     if test "$ans" -eq "1" ;
  25.     then
  26.     echo | zenity --error --text="You have cancel" --width 200 --height 100
  27.     exit 0
  28.     fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement