Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    grep - multiple compare strings on a single invocation?

    I am searching the output of a scanned wifi device and wish to select a couple of pieces of information from different lines.

    I'm trying to locate the Signal Strength, which has a "Quality" indication on the same line. And the SSID on a different line. The following is the pair of output lines
    Quality=44/70  Signal level=-66 dBm
    ESSID:"Jack's Router"
    I use
    #iwlist wlan0 scan | grep -ivF SSID\0x0aQuality
    and it gives me everything, like it matches the new-line character. The i is for ignore case and the v is verbose, which doesn't seem to buy me much.

    Reading the man pages states something like the -F lets you search for multiple strings separated by a new-line character. I've even tried putting it in a script file and actually putting a new-line there which also did not work as the interpreter thought it was another command.

    If anyone has any thoughts about this please advise. Maybe I can't do this like I'm thinking?



  2. #2
    Linux Engineer
    Join Date
    Jan 2005
    Saint Paul, MN
    Have you tried:

    iwlist wlan0 | grep -E 'Quality|ESSID'

    iwlist wlan0 scan | grep 'Quality\|ESSID'
    Either of this should work for you.

Posting Permissions

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