set -- $line
host=$1
names=""
+ nicks=""
## If this is a different host, then start a new section of the list.
case "$last" in
## Build a list of names for the host.
for n in "$@"; do
- names=${names:+$names,}$n
case "$n" in
- *.* | *:*) ;;
- *) names=${names:+$names,}$n.$domain ;;
+ .*) for h in $nicks; do names=${names:+$names,}$h$n,$h$n.$domain; done ;;
+ *.* | *:*) names=${names:+$names,}$n ;;
+ *) nicks=${nicks:+$nicks }$n names=${names:+$names,}$n,$n.$domain ;;
esac
done