前言:我已添加alias airport="sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"
到我的.zshrc
。
myuser:~/ $ airport prefs [17:19:30]
AirPort preferences for en1:
DisconnectOnLogout=NO
JoinMode=Automatic
Unable to retrieve JoinModeFallback
RememberRecentNetworks=YES
RequireAdminIBSS=NO
RequireAdminNetworkChange=NO
RequireAdminPowerToggle=NO
WoWEnabled=YES
myuser:~/ $ airport prefs | grep "JoinMode=" [17:20:36]
Unable to retrieve JoinModeFallback
JoinMode=Automatic
为什么这不能grep
过滤掉这JoinModeFallback
条线?
答案1
因为管道默认只在 stdout 上工作。该行是发送到 stderr 的错误消息。