I want to modify OS-X System Preferences settings using a UNIX shell script, which would be invoked at user login.

I think I can probably get through writing the shell script if I could find out where the System Preferences are stored, and how to access them.

An alternative would be to access System Preferences with an AppleScript, but I haven't figured out how to do that either.

I also want to modify settings in OS-9 Control Panels, done from OS-X, if necessary.

Any help would be greatly appreciated.