Several ways how to get an IP address only, using a Linux command.
ip -f inet addr show eth0 | grep -Po 'inet \K[\d.]+'
ip -4 addr show eth0 | grep -Po 'inet \K[\d.]+'
ip -4 addr show eth0 | grep -oP "(?<=inet ).*(?=/)"
ip -4 addr show eth0 | grep -oP "(?<=inet )[\d\.]+(?=/)"
ip addr show eth0 | awk '$1 == "inet" {gsub(/\/.*$/, "", $2); print $2}'
ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'