#!/bin/bash ip=$(ip a show wlan0 | sed -n 's/inet \([0-9.]*\..*\)\/.*/\1 /p' | tr -d ' ') echo $ip