#!/bin/bash TYPES=($(nmcli device show | grep "GENERAL.TYPE" | awk '{print $2}')) STATES=($(nmcli device show | grep "GENERAL.STATE" | awk '{print $3}')) for ((i = 0; i < "${#TYPES[@]}"; i++)); do if [[ ${STATES[$i]} = "(connected)" ]]; then if [[ ${TYPES[$i]} == *"wifi"* ]]; then echo "直" else echo "ﯱ" fi fi done echo "ﯱ"