 <p>Further messing around yielded the answer: <code>xargs</code> instead of a subshell:</p> <pre><code>echo \'foo bar\' \'baz quux\' | xargs /usr/bin/defaults write com.apple.systemuiserver menuExtras -array </code></pre>