• 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: Christopher Stone <email@hidden>
  • Date: Thu, 27 Mar 2014 11:13:20 -0500

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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Root User
      • From: "koenig.yvan" <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>)

  • 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