home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- ########################################################################
- # #
- # Copyright (c) 1996 by Shomiti Systems, Inc. #
- # ALL RIGHTS RESERVED #
- # #
- # This program is proprietary and confidential information #
- # of Shomiti Systems, Inc. and may be used and disclosed only #
- # as authorized in a license agreement controlling such use #
- # and disclosure. #
- # #
- ########################################################################
-
-
- if [ $# = 0 ]
- then
- echo "Usage: $0 <output file name>"
- echo " Ex: $0 ipname.nam"
- exit 1
- fi
-
- ypcat hosts > $$.txt
-
- if [ $? = 0 ]
- then
- awk '{ if (NR == 1) {print "[IP]";} {print $2 "=" $1;} }' $$.txt > $1
- else
- echo "Error! ypcat commnd is not working properly."
- exit 1
-
- fi
-
- if [ -f $$.txt ]
- then
- \rm $$.txt
- fi
-
-