Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Scripting list?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting list?



On May 26, 2009, at 11:43 AM, Scott Russell wrote:

It's not a shell-script specific list but a lot of shell scripting questions get asked and answered on MacEnterprise.

MacEnterprise

To your specific question, you might try some variation of:

Building=$(dscl /Search read / CPSSearchPath | grep domain.org | awk -F "/" {'print $3'} | cut -c 1-2)

I too am going to recommend MacEnterprise for this sort of thing, and am going to cut two steps out of the suggested script line:

Building=$( /usr/bin/dscl /Search read /CPSSearchPath | /usr/bin/awk '/domain.org/ { print substr($4, 9, 2) }'  )

Thus proving that all you really need for shell scripting is awk... (not seriously).

--
Karl Kuehn



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Default Node corruption 10.5.7 (From: Jaime Magiera <email@hidden>)
 >Re: Default Node corruption 10.5.7 (From: David Haines <email@hidden>)
 >Re: Default Node corruption 10.5.7 (From: Jaime Magiera <email@hidden>)
 >Re: Default Node corruption 10.5.7 (From: Axel Luttgens <email@hidden>)
 >Scripting list? (From: James Palmer <email@hidden>)
 >Re: Scripting list? (From: Scott Russell <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.