I'm writing a script to set a defaults preference for all users on a machine.
When I run it from a root shell, the defaults command runs as if it's been given incorrect arguments.
bash-3.2# su - mheath -c defaults read
Command line interface to a user's defaults.
Syntax:
'defaults' [-currentHost | -host <hostname>]
followed by one of the following:
read shows all
...
I am assuming that using su
is causing the arguments to end up in the wrong place and that defaults is hard coded to expect arguments in certain places. But I've no idea how to get around this.