This utility tells the user what processes they are running and asks
them if they want to kill them with the -9 option. The only
thing new to you here should be the ps -fu call. I am running Cygwin
on my PC so I don't know if the field positions are the same. It is up
to you to make corrections to this utility if you need to. The PID (process
id) should be offered to the user for killing. You are easily at the stage
where you can make amendments to this script yourself, if you have carefully
gone through all the preceding Unix tips and done all the exercises.
| #!/bin/bash
# Script : killjobs # Version : 2.0 # Author : Roland Rashleigh-Berry # Date : 21-Nov-2006 # Contact : rolandberry@hotmail.com # Purpose : To selectively kill -9 Unix processes owned by the user # SubScripts : none # Notes : This script issues kill -9 commands. It would be better if you # tried kills without the -9 option before resorting to this. You # can list your processes by using the command: # ps -fu $USER # ...and issue kills without the -9 options as you like. # Usage : killjobs # #=============================================================================== # PARAMETERS: #-pos- -------------------------------description------------------------------- # N/A (none) #=============================================================================== # AMENDMENT HISTORY: # init --date-- mod-id ----------------------description------------------------ # #=============================================================================== # This is public domain software. No guarantee as to suitability or accuracy is # given or implied. User uses this code entirely at their own risk. #=============================================================================== ps -fu "$USER" > ~/ps.tmp cat ~/ps.tmp echo
rm -f ~/ps.tmp
|
E-mail the macro and web site author.