1 2 3 4 5
#!/bin/bash OUT=$(nmcli device wifi list | grep "^\*" | tail -n 1 | awk -e '{print $2,$8}') echo "network $OUT"