SUMMARY: Script Help

From: Hackett, Peter <PHackett_at_talisman-energy.com>
Date: Thu Aug 21 2003 - 18:14:23 EDT
Thanks to Eugene who suggested the following:

cat /tmp/z|awk '{
if ( $1 == "Connection" ) printf("%s ",$0)
else print $0
}'|grep "not running"


cat /tmp/z|awk '{
if ( $1 == "Connection" ) printf("%s ",$0)
else print $0
}'|grep "not running"|awk '{ print $3}'

-----Original Message-----

I have a script which generates output similar to this and simply emails me
whenever it sees "not running". What I'd like to do is filter this to show
me only the server which is down.

Essentially,  I'd like to turn this:

Connection point: /someserver1
    Server State: running
Connection point: /someserver5
    Server State: running
Connection point: /someserver7
    Server State: not running

into a one liner like this:

    Connection point: /someserver7 Server State: not running

or even just:

    /someserver7

I'm trying to achieve this using just sed or awk statements fed with a pipe.

Any thoughts appreciated.

Pete
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Thu Aug 21 18:14:19 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:18 EST