[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Shell Script Question
- Subject: [ale] Shell Script Question
- From: roninazure at gmail.com (Scott Steele)
- Date: Thu, 11 Aug 2011 19:51:17 -0400
- In-reply-to: <CAEo=5PzRAnEXDdWYOV9c-wp0LFQ+Meex0VX-3RZfQQ516KtPFQ@mail.gmail.com>
- References: <CAPbuv=1nmj6CAUQh70wzSoZbdQwD633QypR3g7SdUADreitUGQ@mail.gmail.com> <CAEo=5PzRAnEXDdWYOV9c-wp0LFQ+Meex0VX-3RZfQQ516KtPFQ@mail.gmail.com>
I haven't been able to try this code yet since I cannot connect to the
server, but would it return with just "1" value after if finishes with a
script? say 1 or -1? That would be what I would be looking for SiteScope to
understand.
On Thu, Aug 11, 2011 at 6:22 PM, Jim Kinney <jim.kinney at gmail.com> wrote:
> | sed -e 's/statereachable.\*/1/' -e 's/stateunreachable.\*/-1/'
> On Aug 11, 2011 6:16 PM, "Scott Steele" <roninazure at gmail.com> wrote:
> > I am relatively a little rusty with the shell scripting and was wondering
> if
> > someone could help me with my dilemma. I use IBM WebSphere and the
> command I
> > use is:
> >
> > xsadmin.sh -p 11111 -bp 11111 -ch servername123 -routetable
> >
> > The output is an example of this:
> >
> > P: partition:83 - state:reachable - ipaddress:servername100 - zone:ZoneB
> >> R: partition:83 - state:reachable - ipaddress:servername101- zone:ZoneA
> > P: partition:84 - state:reachable - ipaddress:servername102 - zone:ZoneB
> >> R: partition:84 - state:reachable - ipaddress:servername103 - zone:ZoneA
> > P: partition:85 - state:reachable - ipaddress:servername104 - zone:ZoneA
> >> R: partition:85 - state:reachable - ipaddress:servername105 - zone:ZoneB
> >
> > And so on.
> >
> > I need to condense the output of this file to send to SiteScope as a file
> > with only values of either <0 or >0. Meaning, if the state:reachable it
> > needs to appear as >0. if state:unreachable than the value needs to
> appear
> > as <0. I basically need to find a way to remove all erroneous info and
> > substitute the words state:reachable or state:unreachable with either <0
> or
> >>0. I have tried many different methods, awk, sed and grep but seem to
> come
> > up short. Any help would be most appreciative and would be a great
> learning
> > tool.
> >
> > Thanks!
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20110811/a548a1cc/attachment.html