Why use the for loop to read Band, Channel, and HTMODE information in the "get_band_defaults" function of the mac80211.sh script,as follows:
get_band_defaults() {
local phy="$1"
for c in $(__get_band_defaults "$phy"); do
local band="${c%%:*}"
c="${c#*:}"
local chan="${c%%:*}"
c="${c#*:}"
local mode="${c%%:*}"
case "$band" in
1) band=2g;;
2) band=5g;;
3) band=60g;;
4) band=6g;;
*) band="";;
esac
[ -n "$band" ] || continue
[ -n "$mode_band" -a "$band" = "6g" ] && return
mode_band="$band"
channel="$chan"
htmode="$mode"
done
}
Because after the end of the loop, only the last Band, Channel, and HTMODE information are used, so I feel that the loop is not necessary.