Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # "stop" a process
- stop(){
- if [ $# -ne 1 ]; then
- echo 1>&2 Usage: stop process
- else
- PROCESS=$1
- echo "Stopping processes with the word ${tGreen}$1${tReset}"
- ps axw | grep -i $1 | awk -v PROC="$1" '{print $1}' | xargs kill -STOP
- fi
- }
- # "cont"inue a process
- cont(){
- if [ $# -ne 1 ]; then
- echo 1>&2 Usage: cont process
- else
- PROCESS=$1
- echo "Continuing processes with the word ${tGreen}$1${tReset}"
- ps axw | grep -i $1 | awk -v PROC="$1" '{print $1}' | xargs kill -CONT
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment