[clug] Python question Re setuid()

Brett Worth brettw at cray.com
Fri Jan 16 04:06:44 GMT 2004


On Fri, 16 Jan 2004, Darren Freeman wrote:

> The following line entered at a shell will print my UID:
> 
> gawk -F ':' '/dfreeman:*/ {print $3}' </etc/passwd


Or 

% id -u dfreeman

The original would match fredfreeman too.

So that form probably should be:

% gawk -F ':' -v uname=$UNAME '$1 == uname {print $3}'  </etc/passwd

-- 
Brett



More information about the linux mailing list