1#!/bin/sh 2# 3# $NetBSD: special_hosts,v 1.1 2018/01/09 03:31:14 christos Exp $ 4# 5 6if [ $# -eq 0 ]; then 7 out=$(getent hosts) 8 [ $? -eq 0 ] || exit 1 9 echo "$out" | awk '{ print $2 }' | sort -u 10 exit 0 11fi 12 13out=$(showmount -E "$1") 14[ $? -eq 0 ] || exit 1 15echo "$out" | awk -v host="$1" \ 16 '{ printf "\"%s\"\t\"%s:%s\" ", $0, host, $0 } END { printf "\n" }' 17 18