Retrieving unique user numbers
Kartik Subbarao
subbarao at phoenix.Princeton.EDU
Sun Apr 28 03:02:16 AEST 1991
In article <3483 at wn1.sci.kun.nl> hansm at cs.kun.nl (Hans Mulder) writes:
>In <1991Apr25.153217.9572 at oakhill.sps.mot.com> root at 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 at phoenix.Princeton.EDU -| Internet
kartik at silvertone.Princeton.EDU (NeXT mail)
SUBBARAO at PUCC.BITNET - Bitnet
More information about the Comp.unix.shell
mailing list