OS X Mountain Lion Server comes with the /usr/sbin/serverinfo command. The serverinfo command can be pretty useful when you’re looking to programmatically obtain information about the very basic state of an OS X Server. The first option indicates whether the Server app has been downloaded from the app store, which is the –software option: serverinfo --software When used, this option reports the following if the Server.app can be found: This system has server software installed. Or if the software cannot be found, the following is indicated: This system does NOT have server software installed. The –productname option can be used to determine the name of the software app: serverinfo --productname If…
-
-
Shell to Clipboard & Back Again
Many times I want to send data straight into the clipboard from a command or script and I don’t really want to have to mess with manually lasso’ing text, using Command-C, etc. What can I say, I’m kinda’ lazy (or working too much, not really sure which). Apple has been kind enough to supply us with a pair of really useful tools for interfacing with the clipboard (er, pasteboard) in Mac OS X: pbcopy and pbpaste. To use pbcopy, which copies text into the pasteboard, simply pipe data to it. For example, if you want to send a directory listing that you run in a script into the pasteboard, you…