I have a bash shell script that runs on login. Even though I selected the "hide" checkbox in system preferences, iTerm still shows while running it.
How do I completely hide it?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Try to run the script with launchd instead. Save a property list like this as
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>some.label</string> <key>Program</key> <string>/path/to/script</string> <key>RunAtLoad</key> <true/> </dict> </plist>
The script should be run the next time you log in. Make sure the script is executable (
chmod +x /path/to/script) and starts with an interpreter line (like
You can also replace the
Program key with for example
<key>ProgramArguments</key> <array> <string>say</string> <string>a</string> </array>
<key>ProgramArguments</key> <array> <string>bash</string> <string>-c</string> <string>say a;ls|say</string> </array>
man launchd.plist or http://osxnotes.net/launchd.html for more information.
Worked great to solve the Mavericks bluetooth always discoverable nightmare using the following script:
#!/bin/sh defaults -currentHost write com.apple.Bluetooth DiscoverableState -bool no launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist 2> /dev/null launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist