grep: Am I losing the plot?
This is typical output from 'sudo iwlist wlan0 scan'
Code:
wlan0 Scan completed : Code:
pi@raspberrypi:~ $ sudo iwlist wlan0 scan |grep -c Channel |
That's not a good test for grep, that output changes all the time!
Why don't you test like this: Code:
sudo iwlist wlan0 scan > text 2>&1 |
Quote:
|
Got more sanity in the wifi output so this issue disappeared. Marking it solved.
BTW average user, the grep had 'Channel:n' & '(Cannel:n )' in it, and I don't thing the second one showed |
I don't understand what you mean but you can make a test:
Code:
$ sudo iwlist wlan0 scan > /tmp/IWLIST_RESULT |
Yeah, here I got 34 & 34.But I went a bit further than your test, adding these lines
Code:
bash-5.0$ grep -A2 Channel /tmp/IWLIST_RESULT | grep -c (Channel |
All times are GMT -5. The time now is 12:16 PM. |