Sometimes Simple Is Better

Python is a great language and can solve a variety of problems. But sometimes, a plain shell script will do just fine.

# -- grabs anyone running fglgo csm and kills their
# process. This must run under root's user, no matter who calls it.
# This has to run and allow sqlexecd to continue running. It's a little
# bit different than
# Change History:

cat /dev/null > /tmp/csm_users

ps -ef | grep -v 'grep' | grep 'fglgo csm' > /tmp/csm_processes


if [ $RC1 -eq 0 ]; then
    while read line
        echo -e "$linen"
        ccmd=`echo $line  | cut -b 8-14`
        kpl="kill -9 $ccmd"
        echo "Forking this kill command $kpl"
    done < /tmp/csm_processes

Leave a comment

Filed under Programming, python

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s