<p>It exchanges statereachable to end of line with 1<br>
Ditto on other with a -1</p>
<p>Note: that &quot;-&quot; may need to be a \- in the sed. Android shell lacking for testing :-)</p>
<div class="gmail_quote">On Aug 11, 2011 7:53 PM, &quot;Scott Steele&quot; &lt;<a href="mailto:roninazure@gmail.com">roninazure@gmail.com</a>&gt; wrote:<br type="attribution">&gt; I haven&#39;t been able to try this code yet since I cannot connect to the<br>
&gt; server, but would it return with just &quot;1&quot; value after if finishes with a<br>&gt; script? say 1 or -1? That would be what I would be looking for SiteScope to<br>&gt; understand.<br>&gt; <br>&gt; On Thu, Aug 11, 2011 at 6:22 PM, Jim Kinney &lt;<a href="mailto:jim.kinney@gmail.com">jim.kinney@gmail.com</a>&gt; wrote:<br>
&gt; <br>&gt;&gt; | sed -e &#39;s/statereachable.\*/1/&#39; -e &#39;s/stateunreachable.\*/-1/&#39;<br>&gt;&gt; On Aug 11, 2011 6:16 PM, &quot;Scott Steele&quot; &lt;<a href="mailto:roninazure@gmail.com">roninazure@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; I am relatively a little rusty with the shell scripting and was wondering<br>&gt;&gt; if<br>&gt;&gt; &gt; someone could help me with my dilemma. I use IBM WebSphere and the<br>&gt;&gt; command I<br>&gt;&gt; &gt; use is:<br>
&gt;&gt; &gt;<br>&gt;&gt; &gt; xsadmin.sh -p 11111 -bp 11111 -ch servername123 -routetable<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; The output is an example of this:<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; P: partition:83 - state:reachable - ipaddress:servername100 - zone:ZoneB<br>
&gt;&gt; &gt;&gt; R: partition:83 - state:reachable - ipaddress:servername101- zone:ZoneA<br>&gt;&gt; &gt; P: partition:84 - state:reachable - ipaddress:servername102 - zone:ZoneB<br>&gt;&gt; &gt;&gt; R: partition:84 - state:reachable - ipaddress:servername103 - zone:ZoneA<br>
&gt;&gt; &gt; P: partition:85 - state:reachable - ipaddress:servername104 - zone:ZoneA<br>&gt;&gt; &gt;&gt; R: partition:85 - state:reachable - ipaddress:servername105 - zone:ZoneB<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; And so on.<br>
&gt;&gt; &gt;<br>&gt;&gt; &gt; I need to condense the output of this file to send to SiteScope as a file<br>&gt;&gt; &gt; with only values of either &lt;0 or &gt;0. Meaning, if the state:reachable it<br>&gt;&gt; &gt; needs to appear as &gt;0. if state:unreachable than the value needs to<br>
&gt;&gt; appear<br>&gt;&gt; &gt; as &lt;0. I basically need to find a way to remove all erroneous info and<br>&gt;&gt; &gt; substitute the words state:reachable or state:unreachable with either &lt;0<br>&gt;&gt; or<br>&gt;&gt; &gt;&gt;0. I have tried many different methods, awk, sed and grep but seem to<br>
&gt;&gt; come<br>&gt;&gt; &gt; up short. Any help would be most appreciative and would be a great<br>&gt;&gt; learning<br>&gt;&gt; &gt; tool.<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Thanks!<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>
&gt;&gt; Ale mailing list<br>&gt;&gt; <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>&gt;&gt; <a href="http://mail.ale.org/mailman/listinfo/ale">http://mail.ale.org/mailman/listinfo/ale</a><br>&gt;&gt; See JOBS, ANNOUNCE and SCHOOLS lists at<br>
&gt;&gt; <a href="http://mail.ale.org/mailman/listinfo">http://mail.ale.org/mailman/listinfo</a><br>&gt;&gt;<br>&gt;&gt;<br></div>