iw 命令自訂無線射頻法規地區# Loading lines from a file or stream - BashFAQ/005 - Greg's Wiki
# https://mywiki.wooledge.org/BashFAQ/005#Loading_lines_from_a_file_or_stream
data=()
mapfile -t lines < "${file}"
for line in "${lines[@]}"; do
empty_line_regex='^[[:space:]]*$'
comment_line_regex='^[[:space:]]*#.*$'
if [[ ${line} =~ ${empty_line_regex} ]] \
|| [[ ${line} =~ ${comment_line_regex} ]]; then
continue;
fi
data+=("${line}")
done