grep -c &quot;stateunreachable&quot;<br><br>This return the count of unreachables<br><br><div class="gmail_quote">On Fri, Aug 12, 2011 at 11:21 AM, Scott Steele <span dir="ltr">&lt;<a href="mailto:roninazure@gmail.com">roninazure@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Yes, just one single output depending on &quot;state:reachable&quot; or &quot;state:unreachable&quot;. On &quot;state:unreachable&quot; I am looking for a return value, say 5,6, etc. On the &quot;state:reachable&quot; just a value say 0 or even none at all.<div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">On Fri, Aug 12, 2011 at 11:03 AM, David Tomaschik <span dir="ltr">&lt;<a href="mailto:david@systemoverlord.com" target="_blank">david@systemoverlord.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div></div><div>On Fri, Aug 12, 2011 at 10:57 AM, Scott Steele &lt;<a href="mailto:roninazure@gmail.com" target="_blank">roninazure@gmail.com</a>&gt; wrote:<br>
&gt; Thanks for your help so far on this, I received further clarification as<br>
&gt; to what I need to do and I think it requires a little tweaking. For the<br>
&gt; ones that are &quot;state:reachable&quot; I don&#39;t need any value returned, or<br>
&gt; maybe a simple echo statement that says &quot;reachable&quot; or a numeric value<br>
&gt; of &quot;-1&quot;. I can change it if necessary.. For the ones that are in<br>
&gt; &quot;state:unreachable&quot;. I need a count of how many return like that. Say<br>
&gt; 5,6,7, or so on.  So the output I am interested in is:<br>
&gt;<br>
&gt; -1 (good)<br>
&gt;<br>
&gt; or<br>
&gt;<br>
&gt; 5 (bad)<br>
&gt;<br>
&gt; This is the script so far that I have. For a reference point.<br>
&gt;<br>
&gt; #!/bin/sh<br>
&gt;<br>
&gt; export JAVA_HOME=/hosting/products/<br>
&gt; WebSphereU01/java<br>
&gt;<br>
&gt; #sets the environment in java<br>
&gt;<br>
&gt; #the values -p -bp and -ch will need to be altered according to what<br>
&gt; needs to be run.<br>
&gt;<br>
&gt; /hosting/ogsa/ogsa-6.1.0.5/ObjectGrid/bin/xsadmin.sh -p 26572 -bp 26570<br>
&gt; -ch nc3sz2ecmus02 -routetable | sed -e &#39;s/.*state:reachable.*/&gt;0/&#39; e<br>
&gt; &#39;s/.*state:unreachable.*/&lt;0/&#39; &gt; `date &quot;+%y%m%d%H%M%S&quot;`.txt<br>
&gt;<br>
&gt; This is the output it produces in its current form.<br>
&gt;<br>
&gt;&gt;0<br>
&gt;<br>
&gt;&gt;0<br>
&gt;<br>
&gt;&gt;0<br>
&gt;<br>
&gt; And so forth.<br>
&gt;<br>
<br>
</div></div>Do you need just a single value to be output?  And is it actually<br>
looking for output, or a return value?<br>
<font color="#888888"><br>
<br>
<br>
--<br>
David Tomaschik, RHCE, LPIC-1<br>
System Administrator/Open Source Advocate<br>
OpenPGP: 0x5DEA789B<br>
<a href="http://systemoverlord.com" target="_blank">http://systemoverlord.com</a><br>
<a href="mailto:david@systemoverlord.com" target="_blank">david@systemoverlord.com</a><br>
</font><div><div></div><div><br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</div></div></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br><br>As long as the general population is passive, apathetic, diverted to 
consumerism or hatred of the vulnerable, then the powerful can do as 
they please, and those who survive will be left to contemplate the 
outcome.<br>- <i><i><i><i>2011 Noam Chomsky<br><br><a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br></i></i></i></i><br>