[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Shell Script Question
- Subject: [ale] Shell Script Question
- From: david at systemoverlord.com (David Tomaschik)
- Date: Fri, 12 Aug 2011 11:03:46 -0400
- In-reply-to: <CAPbuv=1jXpz7NiXaP+EKMMEgERq8CB5H_UzS=QJnyOiYijVPcQ@mail.gmail.com>
- References: <CAPbuv=1nmj6CAUQh70wzSoZbdQwD633QypR3g7SdUADreitUGQ@mail.gmail.com> <CAEo=5PzRAnEXDdWYOV9c-wp0LFQ+Meex0VX-3RZfQQ516KtPFQ@mail.gmail.com> <CAPbuv=3nSZPH4FiCqTckWndwQ9Ma2xF5f4EX=ie5Rh7pDG3XHw@mail.gmail.com> <[email protected]> <CAEo=5PwzEoumPtUygULo9ajWmjD-te6GE+T1a2+4tV1GbF4FAw@mail.gmail.com> <CAPbuv=1y0F_jJxq2DuJ94gdxDahUdSEvBiV6r01QvNWHvbumhw@mail.gmail.com> <CAPbuv=1jXpz7NiXaP+EKMMEgERq8CB5H_UzS=QJnyOiYijVPcQ@mail.gmail.com>
On Fri, Aug 12, 2011 at 10:57 AM, Scott Steele <roninazure at gmail.com> wrote:
> Thanks for your help so far on this, I received further clarification as
> to what I need to do and I think it requires a little tweaking. For the
> ones that are "state:reachable" I don't need any value returned, or
> maybe a simple echo statement that says "reachable" or a numeric value
> of "-1". I can change it if necessary.. For the ones that are in
> "state:unreachable". I need a count of how many return like that. Say
> 5,6,7, or so on. ?So the output I am interested in is:
>
> -1 (good)
>
> or
>
> 5 (bad)
>
> This is the script so far that I have. For a reference point.
>
> #!/bin/sh
>
> export JAVA_HOME=/hosting/products/
> WebSphereU01/java
>
> #sets the environment in java
>
> #the values -p -bp and -ch will need to be altered according to what
> needs to be run.
>
> /hosting/ogsa/ogsa-6.1.0.5/ObjectGrid/bin/xsadmin.sh -p 26572 -bp 26570
> -ch nc3sz2ecmus02 -routetable | sed -e 's/.*state:reachable.*/>0/' e
> 's/.*state:unreachable.*/<0/' > `date "+%y%m%d%H%M%S"`.txt
>
> This is the output it produces in its current form.
>
>>0
>
>>0
>
>>0
>
> And so forth.
>
Do you need just a single value to be output? And is it actually
looking for output, or a return value?
--
David Tomaschik, RHCE, LPIC-1
System Administrator/Open Source Advocate
OpenPGP: 0x5DEA789B
http://systemoverlord.com
david at systemoverlord.com