<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 08/11/2011 07:51 PM, Scott Steele wrote:
    <blockquote
cite="mid:CAPbuv=3nSZPH4FiCqTckWndwQ9Ma2xF5f4EX=ie5Rh7pDG3XHw@mail.gmail.com"
      type="cite">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.<br>
      <br>
      <div class="gmail_quote">On Thu, Aug 11, 2011 at 6:22 PM, Jim
        Kinney <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:jim.kinney@gmail.com">jim.kinney@gmail.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <p>| sed -e 's/statereachable.\*/1/' -e
            's/stateunreachable.\*/-1/'</p>
          <div>
            <div class="h5">
              <div class="gmail_quote">On Aug 11, 2011 6:16 PM, "Scott
                Steele" &lt;<a moz-do-not-send="true"
                  href="mailto:roninazure@gmail.com" target="_blank">roninazure@gmail.com</a>&gt;
                wrote:<br type="attribution">
                &gt; I am relatively a little rusty with the shell
                scripting and was wondering if<br>
                &gt; someone could help me with my dilemma. I use IBM
                WebSphere and the command I<br>
                &gt; use is:<br>
                &gt; <br>
                &gt; xsadmin.sh -p 11111 -bp 11111 -ch servername123
                -routetable<br>
                &gt; <br>
                &gt; The output is an example of this:<br>
                &gt; <br>
                &gt; P: partition:83 - state:reachable -
                ipaddress:servername100 - zone:ZoneB<br>
                &gt;&gt; R: partition:83 - state:reachable -
                ipaddress:servername101- zone:ZoneA<br>
                &gt; P: partition:84 - state:reachable -
                ipaddress:servername102 - zone:ZoneB<br>
                &gt;&gt; R: partition:84 - state:reachable -
                ipaddress:servername103 - zone:ZoneA<br>
                &gt; P: partition:85 - state:reachable -
                ipaddress:servername104 - zone:ZoneA<br>
                &gt;&gt; R: partition:85 - state:reachable -
                ipaddress:servername105 - zone:ZoneB<br>
                &gt; <br>
                &gt; And so on.<br>
                &gt; <br>
                &gt; I need to condense the output of this file to send
                to SiteScope as a file<br>
                &gt; with only values of either &lt;0 or &gt;0. Meaning,
                if the state:reachable it<br>
                &gt; needs to appear as &gt;0. if state:unreachable than
                the value needs to appear<br>
                &gt; as &lt;0. I basically need to find a way to remove
                all erroneous info and<br>
                &gt; substitute the words state:reachable or
                state:unreachable with either &lt;0 or<br>
                &gt;&gt;0. I have tried many different methods, awk, sed
                and grep but seem to come<br>
                &gt; up short. Any help would be most appreciative and
                would be a great learning<br>
                &gt; tool.<br>
                &gt; <br>
                &gt; Thanks!<br>
              </div>
            </div>
          </div>
          <br>
        </blockquote>
      </div>
    </blockquote>
    <br>
    Are you looking for return value or output?  For output, Jim's sed
    commands should work, but you might need a ".*" at the beginning of
    each pattern.<br>
    <br>
    Providing sample output with the sample input would probably help
    everyone understand.<br>
    <br>
    David<br>
  </body>
</html>