fred@umcp-cs.UUCP (07/27/83)
This is a silly little command which prints your current group-id. Sometimes useful. : Run this shell script with "sh" not "csh" PATH=:/bin:/usr/bin:/usr/ucb export PATH /bin/echo 'Extracting pwg.1' sed 's/^X//' <<'//go.sysin dd *' >pwg.1 X.TH PWG 1 "1/22/82 (U of M)" X.UC 4 X.SH NAME Xpwg \- print working (current) group name X.SH SYNOPSIS X.B pwg X.SH DESCRIPTION X.I Pwg Xprints the name of the (accounting) group you are currently logged in to. X.SH "SEE ALSO" Xnewgrp(1), chgrp(8) X.SH BUGS //go.sysin dd * /bin/chmod 644 pwg.1 /bin/echo -n ' '; /bin/ls -ld pwg.1 /bin/echo 'Extracting pwg.c' sed 's/^X//' <<'//go.sysin dd *' >pwg.c Xstatic char *sccsid = "@(#)pwg.c 1/22/82 (University of Maryland)"; X X#include <stdio.h> X#include <grp.h> X X/* X * pwg - print working group name X * X * Fred Blonder <fred@umcp-cs> X */ X Xmain() X{ Xregister struct group *gp; Xregister int gid; Xstruct group *getgrgid(); X Xgid = getgid(); X Xif ((gp = getgrgid(gid)) != NULL) X printf("%s\n", gp -> gr_name); Xelse X printf("%d\n", gid); X} //go.sysin dd * /bin/chmod 644 pwg.c /bin/echo -n ' '; /bin/ls -ld pwg.c
perelgut@utcsrgv.UUCP (Stephen Perelgut) (07/29/83)
: "pwg - Print present working group - Mart Molle : University of Toronto - Computer System Research Group - Oct 1982" : <Published without permission by Stephen Perelgut > echo > /tmp/$$ ls -lg /tmp/$$|(read protect links group other; echo $group) rm /tmp/$$ -- --- Stephen Perelgut --- {decvax!utzoo,linus}!utcsrgv!perelgut {cornell,watmath,floyd,allegra,uw-beaver,ubc-vision,ihnp4}!utcsrgv!perelgut