In Mac OS, I've created a few AppleScripts to add and remove start up applications (Login Items, under the Accounts system pane).
#!/bin/bash
/usr/bin/osascript -e "tell application \"System Events\" to make new login item with properties { path: \"$1\", hidden:false } at end"
Usage would be like this:
./addloginitem.sh /Applications/TextEdit.app
I'm curious if it's possible to have startup items that use arguments? I have a program that I would like to pass a "startup" argument to if it is running directly after a login.