Find the answer to your Linux question:
Results 1 to 3 of 3
Hi there, Can someone please tell me what 'sed' command I need to extract "10.2.0.4SE" from the following file please .. GVPCOGPR:/opt/app/oracle/product/10.2.0.4SE:N GVPGCOGPR:/opt/app/oracle/product/10.2.0.4SE:N GVPV6CPP:/opt/app/oracle/product/10.2.0.4SE:Y I've tried a number of ways ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    5

    Help with 'sed' command please


    Hi there,

    Can someone please tell me what 'sed' command I need to extract "10.2.0.4SE" from the following file please ..

    GVPCOGPR:/opt/app/oracle/product/10.2.0.4SE:N
    GVPGCOGPR:/opt/app/oracle/product/10.2.0.4SE:N
    GVPV6CPP:/opt/app/oracle/product/10.2.0.4SE:Y

    I've tried a number of ways but it's driving me insane !

    Many thanks in advance.

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,380
    This should do
    Code:
    sed -rn 's#^GVP.*/([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:alnum:]]+):.*$#\1#p'  YOUR_TEXTFILE
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    5
    Dynamite

    Cheers fella

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •