Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bria!mike From: mike@bria.UUCP (Michael Stefanik) Newsgroups: comp.unix.shell Subject: Re: Retrieving unique user numbers Message-ID: <220@bria.UUCP> Date: 27 Apr 91 04:00:52 GMT References: <1991Apr25.153217.9572@oakhill.sps.mot.com> Reply-To: uunet!bria!mike Distribution: comp.unix.shell Organization: MGI Group International, Los Angeles, CA Lines: 20 In an article, root@oakhill.sps.mot.com (Operator) writes: |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. How about ... myuid() { expr "`id`" : 'uid=\([0-9]*\).*' } echo "My uid is `myuid`" -- Michael Stefanik, MGI Inc, Los Angeles | Opinions stated are never realistic Title of the week: Systems Engineer | UUCP: ...!uunet!bria!mike ------------------------------------------------------------------------------- If MS-DOS didn't exist, who would UNIX programmers have to make fun of?