• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: User Name in OS X +
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: User Name in OS X +
      • From: John W Baxter <email@hidden>
References: 
 >Re: User Name in OS X + (From: "John C. Welch" <email@hidden>)

  • Prev by Date: Re: Applescript send problem
  • Next by Date: Re: Exists statements
  • Previous by thread: Re: Eudora Settings was Re: User N...
  • Next by thread: Re: User Name in OS X +
  • Index(es):
    • Date
    • Thread