
実行するとsudo wpa_supplicant -Dwext -iwlan3 -cwifi.conf 2>&1
次のようになります:
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.
しかし、実行すると:
sudo wpa_supplicant -Dwext -iwlan3 -cwifi.conf 2>&1 | grep --line-buffered wlan3
私が得るのは:
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
適切にリダイレクトされていないのでしょうかstderr
?
答え1
パイプ コンシューマである grep は行バッファリングされます。ただし、これはパイプ プロデューサーには影響しません。パイプラインのその側を調整すると、grep は目的の出力を生成します。