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