Re: Owner/User Name in OSX
Re: Owner/User Name in OSX
- Subject: Re: Owner/User Name in OSX
- From: bill <email@hidden>
- Date: Fri, 26 Apr 2002 17:54:37 +0800
John,
It happens that I just read a book few days ago, and remember the command
finger. The book title is 3A Student9s Guide to Unix2, written by Harley
Hahn; an excellent introduction level book.
Simon asked for the long name of the current owner/user in the original
post, several assumptions under Mac OS X:
1. when one login (or automatic login, the step before you see the desktop,
one logs in to console.
2. when one activates the terminal, one logs in to ttypXX (XX is integer),
try the 3who2 command and you9ll know what I mean.
3. So, either system attribute 2USER2, or do shell script 3whoami2 will
return the current user only.
-- below code in one line
set longName to words 4 thru -1 of paragraph 1 of (do shell script ("finger
" & (system attribute "USER")))
-- above code in one line
4. In my first suggestion, since the userID (shortname) are restricted to 8
lowercase characters or fewer with no space, therefore, word 4 thru last
word of paragraph 1 of the result is the long name, an applescript like
suggestion.
-- below code in one line, space between grep & Login
do shell script "finger " & (system attribute "USER") & " | grep Login |
colrm 1 46"
-- above code in one line
5. My second suggestion, more 3shell looking2, will return the long name as
string.
Well, if the current user is not the owner, it9s quite difficult to find out
the long name of the owner, or other users.
My guess.
Bill
[OT] how do we find the sequence of each post, from different time zone,
when our list server is...?
_______________________________________________
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.