DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: @ T c

⟦88dbe1cc2⟧ TextFile

    Length: 1053 (0x41d)
    Types: TextFile
    Notes: @(#)chk_pgrp.sh 13.1 (RC International) 91/07/25
    Names: »chk_pgrp«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./usr/sadm/sysadm/bin/chk_pgrp« 

TextFile

#	@(#)chk_pgrp.sh	13.1 (RC International) 91/07/25

#	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#!/sbin/sh
#ident	"@(#)oamintf:usermgmt/chk_pgrp.sh	1.4"

################################################################################
#	Command Name: chk_pgrp
#
# 	This functions is used for validating the Primary Group
################################################################################

NOTHING=1	# Nothing entered
NOTUNIQ=2	# Not unique
OK=0		# login name (ID) is valid

test -z "$1" && exit $NOTHING

DEF_GRPNAM=
DEF_GRPID=

test "$1" = "$DEF_GRPNAM" || test "$1" = "$DEF_GRPID" && exit $OK

sed -e 's/^\([^:]*\):[^:]*:\([^:]*\).*/\1,\2/p' \
-e '/,[0-9]\{1,2\}$/d' /etc/group | grep "^$1," > /dev/null ||

sed -e 's/^\([^:]*\):[^:]*:\([^:]*\).*/\1,\2/p' \
-e '/,[0-9]\{1,2\}$/d' /etc/group | grep ",$1$" > /dev/null && exit $OK || exit 1