diff --git a/usr.bin/id/Makefile b/usr.bin/id/Makefile index fdb0ef8140ba..8f402820779e 100644 --- a/usr.bin/id/Makefile +++ b/usr.bin/id/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.7 1997/03/24 21:59:39 christos Exp $ +# $NetBSD: Makefile,v 1.8 1998/10/14 00:55:03 wsanchez Exp $ # from: @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= id MAN= id.1 groups.1 whoami.1 -SCRIPTS=groups.sh whoami.sh +LINKS= ${BINDIR}/id ${BINDIR}/groups +LINKS+= ${BINDIR}/id ${BINDIR}/whoami .include diff --git a/usr.bin/id/groups.sh b/usr.bin/id/groups.sh deleted file mode 100644 index b0bf6c898bc2..000000000000 --- a/usr.bin/id/groups.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# $NetBSD: groups.sh,v 1.3 1997/01/09 20:20:04 tls Exp $ -# -# Copyright (c) 1991, 1993 -# The Regents of the University of California. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the University of -# California, Berkeley and its contributors. -# 4. Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# from: @(#)groups.sh 8.1 (Berkeley) 6/6/93 -# $NetBSD: groups.sh,v 1.3 1997/01/09 20:20:04 tls Exp $ -# - -id -Gn $* diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c index 81fa7f1c797d..5c9043eb42e5 100644 --- a/usr.bin/id/id.c +++ b/usr.bin/id/id.c @@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\ #if 0 static char sccsid[] = "@(#)id.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: id.c,v 1.11 1998/10/12 20:33:52 erh Exp $"); +__RCSID("$NetBSD: id.c,v 1.12 1998/10/14 00:55:03 wsanchez Exp $"); #endif #endif /* not lint */ @@ -72,9 +72,20 @@ main(argc, argv) { struct group *gr; struct passwd *pw; - int Gflag, ch, gflag, id, nflag, pflag, rflag, uflag; + int ch, id; + int Gflag, gflag, nflag, pflag, rflag, uflag; Gflag = gflag = nflag = pflag = rflag = uflag = 0; + + if (!strcmp(__progname, "groups")) { + Gflag = 1; + nflag = 1; + } + else if (!strcmp(__progname, "whoami")) { + uflag = 1; + nflag = 1; + } + while ((ch = getopt(argc, argv, "Ggnpru")) != -1) switch(ch) { case 'G': diff --git a/usr.bin/id/whoami.sh b/usr.bin/id/whoami.sh deleted file mode 100644 index 71cd82f6fcf3..000000000000 --- a/usr.bin/id/whoami.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# $NetBSD: whoami.sh,v 1.3 1997/01/09 20:20:06 tls Exp $ -# -# Copyright (c) 1991, 1993 -# The Regents of the University of California. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the University of -# California, Berkeley and its contributors. -# 4. Neither the name of the University nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# from: @(#)whoami.sh 8.1 (Berkeley) 6/6/93 -# $NetBSD: whoami.sh,v 1.3 1997/01/09 20:20:06 tls Exp $ -# - -id -un