Hey wize ones. Ok, got a pretty small file, it's actually just one long line. I need to pull the last two variables out of the line, problem is the length of the line changes from time to time, so I dont know the exact position... Here's what the file looks like:
2XHENVVAR IBM_JAVA_COMMAND_LINE=/opt/was5/base/crm/java/bin/java +-Djava.net.preferIPv4Stack=true -Dwas.status.socket=55962 -Xbootclass +path/p:/opt/was5/b ase/crm/java/jre/lib/ext/ibmorb.jar:/opt/was5/base/crm/java/jre/lib/ex +t/ibmext.jar -classpath /prod/wesadm/wes/was5/base/instances/crm-unit +c-01_01/properties :/opt/was5/base/crm/properties:/opt/was5/base/crm/lib/bootstrap.jar:/o +pt/was5/base/crm/lib/j2ee.jar:/opt/was5/base/crm/lib/lmproxy.jar:/opt +/was5/base/crm/lib /urlprotocols.jar -Xms50m -Xmx256m -Dws.ext.dirs=/opt/was5/base/crm/ja +va/lib:/prod/wesadm/wes/was5/base/instances/crm-unitc-01_01/classes:/ +opt/was5/base/crm/ classes:/opt/was5/base/crm/lib:/opt/was5/base/crm/lib/ext:/opt/was5/ba +se/crm/web/help:/opt/was5/base/crm/deploytool/itp/plugins/com.ibm.eto +ols.ejbdeploy/runt ime -Dserver.root=/prod/wesadm/wes/was5/base/instances/crm-unitc-01_01 + -Ddb2j.system.home=/prod/wesadm/wes/was5/base/instances/crm-unitc-01 +_01/cloudscape -Du ser.install.root=/prod/wesadm/wes/was5/base/instances/crm-unitc-01_01 +-Dcom.ibm.itp.location=/prod/wesadm/wes/was5/base/instances/crm-unitc +-01_01/bin -Dwas.i nstall.root=/opt/was5/base/crm -Dibm.websphere.preload.classes=true -D +java.io.tmpdir=/var/adm/corefiles/wes/crm_dceweb_ear-unitc -DIBM_HEAP +DUMP=true -DIBM_HE AP_DUMP=true -DIBM_HEAPDUMPDIR=/var/adm/corefiles/wes/crm_dceweb_ear-u +nitc -DIBM_HEAPDUMP_OUTOFMEMORY=true -DIBM_JAVADUMP_OUTOFMEMORY=true +-DIBM_JAVA_HEAPDUM P_TEXT=true -Djava.security.auth.login.config=/prod/wesadm/wes/was5/ba +se/instances/crm-unitc-01_01/properties/wsjaas.conf -Djava.security.p +olicy=/prod/wesadm /wes/was5/base/instances/crm-unitc-01_01/properties/server.policy com. +ibm.ws.bootstrap.WSLauncher com.ibm.ws.runtime.WsServer /prod/wesadm/ +wes/was5/base/inst ances/crm-unitc-01_01/config crm-unitc-01 host1_crm-unitc-01_01 id_ser +ver_ear-unitc
I need the last 2 variables...
host1_crm-unitc-01_01 id_server_ear-unitc
Any ideas?

In reply to Question on File position, pulling words by taints169

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.