\begin{Steve Kowalik}
> On Thu, Sep 20, 2001 at 01:35:25AM +1000, Peter Hardy uttered:
> > grep $HOME /etc/passwd | awk -F : '{ readline; print $1 }'
> 
> steven@broken:~$ grep $HOME /etc/passwd | awk -F : '{ readline; print $1 }'
> steven@broken:~$
> 
> But, I use LDAP for auth. :-)

in that case use the libc routines. easiest way to get at them is
through perl:

 perl -e 'print scalar getpwuid $<'

> steven@broken:~$ echo $USER
> steven
> 
> Should be more than sufficient, given a non-brain dead shell like bash or zsh.

.. and does the Right Thing when run through sudo and other such
wrappers.

use the env variables, they're Good.

-- 
 - Gus

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to