<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[walkah]]></title>
  <link href="http://walkah.net/atom.xml" rel="self"/>
  <link href="http://walkah.net/"/>
  <updated>2012-04-13T16:54:16-04:00</updated>
  <id>http://walkah.net/</id>
  <author>
    <name><![CDATA[James Walker]]></name>
    
  </author>

  
  <entry>
    <title type="html"><![CDATA[Mac OS X from the command line]]></title>
    <link href="http://walkah.net/blog/walkah/mac-os-x-command-line"/>
    <updated>2007-08-02T00:00:00-04:00</updated>
    <id>http://walkah.net/blog/walkah/mac-os-x-from-the-command-line</id>
    <content type="html"><![CDATA[<p>Dear Apple, I love you, but sometimes you drive me up the wall.</p>


<p>I've been playing around with a little project to set up sandbox drupal sites on a mac mini (more details on that later) ... that's easy stuff, but the annoying part is: I'd like to share directories via <a href="http://www.samba.org/">Samba</a> which needs system accounts. The trick is, I want to add all of this via a simple little shell script. No problem right? Simple one line call to <code>useradd</code>... right?! Noooooooooo. Not in OS X. No, in OS X <em>this</em> is how you <a href="http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/additionalfeatures/chapter_10_section_9.html#//apple_ref/doc/uid/TP40002856-BBCDBFBD">add user accounts from the commandline</a> (which, of course, is under "Porting unix/linux applications"):</p>


<pre>
# dscl / -create /Users/portingunix
# dscl / -create /Users/portingunix UserShell /bin/bash
# dscl / -create /Users/portingunix RealName "Porting Unix 
# dscl / -create /Users/portingunix UniqueID 503
# dscl / -create /Users/portingunix PrimaryGroupID 1000
# dscl / -create /Users/portingunix NFSHomeDirectory /Local/Users/portingunix
# passwd portingunix
</pre>


<p>I dunno... I think that's just annoying. Perhaps NetInfo has some beauty that I'm just don't understand, but, couldn't Apple at least ship with some standard <code>useradd</code> wrappers or something?</p>

]]></content>
  </entry>
  
</feed>

