home *** CD-ROM | disk | FTP | other *** search
- #ident "@(#)/usr/sadm/sysadm/bin/validname.sl 1.1 4.0 12/08/90 28995 AT&T-USL"
-
- ################################################################################
- # Module Name: validname.sh
- #
- # Inputs:
- # $1 - system name
- #
- # Description: Verify a valid system name was entered.
- #
- # Note that the input is concatenated to "hh" and then
- # the expression is evaluated with expr. Certain characters
- # such as - and * have special meaning if they occur as lone
- # strings to expr.
- #
- ###############################################################################
- NEWARG="hh"$1
- # does $1 begin with -?
- if [ `expr $NEWARG : 'hh-'` -eq 3 ]
- then
- exit 1
- fi
- echo $NEWARG
- if [ `expr $NEWARG : '[0-9A-Za-z-]*'` -eq `expr $NEWARG : '.*'` ]
- then
- exit 0
- else
- exit 1
- fi
-
-