Re: User Name in OS X +
Re: User Name in OS X +
- Subject: Re: User Name in OS X +
- From: "Jared ''Danger'' Earle" <email@hidden>
- Date: Wed, 23 Oct 2002 00:58:52 +0200
On Tuesday, Oct 22, 2002, at 15:37 Europe/Paris, John C. Welch wrote:
I'm having trouble getting the full "User Name" of the current user
with AS.
do shell script "echo $USER"
That gives you the short name, not the long name, which is what he's
looking
for.
Besides, that command's twice as long as it needs to be:
do shell script "whoami"
That returns the username, not the "User Name". For that, you need...
do shell script "nidump passwd / | grep `whoami` | awk -F ':' '{print
$8}'"
That trawls the password file for the user login and outputs the full
name. It's not perfect, but it'll do for now.
--
Jared Earle, Nightfall Games, email@hidden -
http://www.23x.net
"Smell the fragrance of the feathers of the angel of SPORK!"
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.