Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!news.cs.indiana.edu!att!princeton!phoenix.Princeton.EDU!tty!keyboard!subbarao!kartik From: subbarao@phoenix.Princeton.EDU (Kartik Subbarao) Newsgroups: comp.unix.shell Subject: Re: Retrieving unique user numbers Message-ID: Date: 27 Apr 91 17:02:16 GMT References: <1991Apr25.153217.9572@oakhill.sps.mot.com> <3483@wn1.sci.kun.nl> Sender: news@idunno.Princeton.EDU Reply-To: subbarao@phoenix.Princeton.EDU (Kartik Subbarao) Distribution: comp.unix.shell Lines: 29 In article <3483@wn1.sci.kun.nl> hansm@cs.kun.nl (Hans Mulder) writes: >In <1991Apr25.153217.9572@oakhill.sps.mot.com> root@oakhill.sps.mot.com (Operator) writes: > >>Hello all -- > >>I was asked by a user how to retrieve/identify the unique >>user number from within the shell environment (ksh). What >>he is looking for would, preferably, function in much the >>same fashion as the command [echo `/usr/bin/logname`], where >>the result of this op could then be piped into a subsequent >>operation. > >On this system (running SunOS 4.1.1) > >id | sed 's/[^=]*=//;s/(.*//' Ik ik ik. This looks cooler: % perl -e 'print $<;' And it works on more systems than just SunOS 4.1.1. -Kartik -- internet# rm `df | tail +2 | awk '{ printf "%s/quotas\n",$6}'` subbarao@phoenix.Princeton.EDU -| Internet kartik@silvertone.Princeton.EDU (NeXT mail) SUBBARAO@PUCC.BITNET - Bitnet