0

This question already has an answer here:

When I run sudo wpa_supplicant -Dwext -iwlan3 -cwifi.conf 2>&1 I get:

Successfully initialized wpa_supplicant
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
wlan3: Trying to associate with 9c:3d:cf:fb:95:96 (SSID='Bell514' freq=2462 MHz)
wlan3: Association request to the driver failed
wlan3: Associated with 9c:3d:cf:fb:95:96
wlan3: Authentication with 9c:3d:cf:fb:95:96 timed out.

Yet when I run:

sudo wpa_supplicant -Dwext -iwlan3 -cwifi.conf 2>&1 | grep --line-buffered wlan3

I only get:

ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

Am I not redirecting the stderr properly?

marked as duplicate by Philip Kirkbride, Community Nov 29 '17 at 17:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    possibly wpa_supplicant is buffering its output because it's not going to a terminal. Try running it with sudo stdbuf -o0 wpa_supplicant... | grep... to see if that makes a difference. – Stéphane Chazelas Nov 23 '17 at 19:48
  • You might want to include a wifi.conf file so that other users can easily reproduce your output. – igal Nov 23 '17 at 20:08
  • 1
    @StéphaneChazelas thanks, that seems to fix my issue – Philip Kirkbride Nov 23 '17 at 20:29
  • @StéphaneChazelas do you want to post as an answer as I can't close and what you suggested is what works best – Philip Kirkbride Nov 23 '17 at 23:40
0

The pipe consumer, grep, is line buffered. But that doesn't affect the pipe producer. Once you adjust that side of the pipeline grep will produce the desired output.

Not the answer you're looking for? Browse other questions tagged or ask your own question.