#!/bin/bash if [ -z "$1" ]; then echo -e "Usage: ${0##*/} iface" exit fi iface=$1 IFS="$IFS:" while read -a line ; do if [ "${line[0]}" = "${iface}" ]; then echo -e "${line[1]}\n${line[9]}" found=yes fi done