• 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: will this code test if a user is in a group?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: will this code test if a user is in a group?


  • Subject: Re: will this code test if a user is in a group?
  • From: email@hidden
  • Date: Fri, 18 Jul 2008 10:21:08 -0400


I ended up writing some code for detecting group membership in a shell script (bash)

-----------
#!/bin/bash

if id -G | grep -q groupnumber
then
        "in group"
else
        "not in group"
fi
-----------

There were some potential issues -- what if the test was for group 57 and the person was in group 570?

Thanks for letting me know about this utility.

Charles Profitt
Sr. Network Technician
BrainBench Certified - (Master)Microsoft Security | (Master)Storage Area Networks Concepts | (Master)Microsoft Vista Desktop Administration | (Master)Macintosh OS X 10.4 Desktop Administration
75 Barker Road
Pittsford, NY 14534

Important Notice:
This communication, including any attachments, is intended only for the use of the individual(s) or entity(s) to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this communication is not the intended recipient, you are hereby notified that any dissemination, distribution or reproduction of any part of this communication in any format is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this communication and deleting the original and any automatically generated copies. Thank-you for your co-operation.



Jeremy Reichman <email@hidden>
Sent by: applescript-users-bounces+chas_profitt=email@hidden

07/18/2008 10:09 AM

To
<email@hidden>
cc
Subject
Re: will this code test if a user is in a group?





Following up on Axel's comment on "dsmemberutil," 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: will this code test if a user is in a group?
      • From: Jeremy Reichman <email@hidden>
References: 
 >will this code test if a user is in a group? (From: email@hidden)
 >Re: will this code test if a user is in a group? (From: Jeremy Reichman <email@hidden>)

  • Prev by Date: Re: will this code test if a user is in a group?
  • Next by Date: Re: what is CodeResource? how to make bundles applescriptable?
  • Previous by thread: Re: will this code test if a user is in a group?
  • Next by thread: Re: will this code test if a user is in a group?
  • Index(es):
    • Date
    • Thread