• 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: Root User
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Root User


  • Subject: Re: Root User
  • From: "koenig.yvan" <email@hidden>
  • Date: Thu, 27 Mar 2014 17:21:15 +0100


Le 27/03/2014 à 17:13, Christopher Stone <email@hidden> a écrit :

On Mar 27, 2014, at 10:23, koenig.yvan <email@hidden> wrote:
I'm not sure but it seems that these instructions may help :

do shell script "whoami"
do shell script "id " & result
______________________________________________________________________

While it's useful to see these commands as separate entities, it's more efficient to run them in the same call to do shell script.

do shell script "id `whoami`"

OR

do shell script "whoami | id"

set isAdmin to result contains "80(admin)"

on isAdmin()
try
do shell script "whoami | id | grep -q '80(admin)'"
true
on error
false
end try
end isAdmin

isAdmin()

--
Best Regards,
Chris

Thanks Chris

I just forgot the correct syntax.

I will store it in my good old library from which I extract needed handlers.

Do you know the way to decipher the first numerical value:
501 when I run from my main account
201 when I run as Guest ?

Maybe it may say if the account matches the first condition :
1. A Mac user, that is, a user whose home folder is in the startupDisk:Users: folder.


Yvan KOENIG (VALLAURIS, France) jeudi 27 mars 2014 17:21:05


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Root User (From: Luther Fuller <email@hidden>)
 >Re: Root User (From: Luther Fuller <email@hidden>)
 >Re: Root User (From: "koenig.yvan" <email@hidden>)
 >Re: Root User (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Root User
  • Next by Date: Re: Root User
  • Previous by thread: Re: Root User
  • Next by thread: Re: Root User
  • Index(es):
    • Date
    • Thread