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