Find the answer to your Linux question:
Results 1 to 4 of 4
How do I add a blank space to the egrep below? I want to search for port 25 and a blank? It must be an exact match 25 with a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2004
    Posts
    8

    Regular Expression


    How do I add a blank space to the egrep below? I want to search for
    port 25 and a blank? It must be an exact match 25 with a trailing blank.
    That is my search criteria. Currently anything that begins with 25 is returned.

    ex: 256 2567 25555 I only want matches on 25 and a space.


    egrep "to outside:[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/25" /var/log/messages

  2. #2
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Ummm...escape a space: "\ "
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  3. #3
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    that should work.
    -lakerdonald

  4. #4
    Just Joined!
    Join Date
    Jun 2004
    Posts
    8

    SYSLOG

    For some reason that doesn't work . It returns no matches. If you have a second try it out with my line.

    Thanks,

Posting Permissions

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