I'm using the Sierra OS. I'm trying to run a script for hiding the menu bar on a few systems. I'm using the following as my script:
#!/bin/sh
defaults write NSGlobalDomain _HIHideMenuBar -bool true
killall Finder
It says that it runs without any error but the result does not hide the menu bar or even toggle the "Automatically hide and show the menu bar" option under General in System Preferences. If I run the command locally, it works just fine. Is there some issue with doing this remotely? Is there something I'm missing?