Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!slxsys!ibmpcug!demon!cliff From: cliff@demon.co.uk (Cliff Stanford) Newsgroups: comp.unix.shell Subject: Re: Retrieving unique user numbers Message-ID: <1991Apr27.212948.14327@demon.co.uk> Date: 27 Apr 91 21:29:48 GMT References: <1991Apr25.153217.9572@oakhill.sps.mot.com> Distribution: comp.unix.shell Organization: Demon Systems Limited Lines: 17 In article <1991Apr25.153217.9572@oakhill.sps.mot.com> 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. echo `grep \^\`/usr/bin/logname\` /etc/passwd | cut -d: -f3` Isn't shell quoting wonderful? :-) Cliff -- Cliff Stanford Email: cliff@demon.co.uk (Work) Demon Systems Limited cms@demon.co.uk (Home) 42 Hendon Lane Phone: 081-349 0063 (Office) London N3 1TT England 0860 375870 (Mobile)