#!/bin/bash cd /var/cpanel/users for i in *; do domain=$(grep DNS\= $i | cut -d "=" -f 2-) ip=$(grep IP\= $i | cut -d "=" -f 2-) echo -e "${ip}\t${domain}\twww.${domain}" extradomains=$(grep DNS[0-9] $i | cut -d "=" -f 2-) for extradomain in $extradomains; do echo -e "${ip}\t${extradomain}\twww.${extradomain}" done done