This forum post has a bash script for OSX that should do the trick. It takes the username as an argument and departs from that user.
I have not tried, so your mileage may vary. But it looks like it fits your needs. What exactly are you trying to achieve?
andrewdotnich
source share