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?


Try to run the script with launchd instead. Save a property list like this as ~/Library/LaunchAgents/some.label.plist:

<?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">

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 #!/usr/bin/env bash).

You can also replace the Program key with for example



  <string>say a;ls|say</string>

See man launchd.plist or http://osxnotes.net/launchd.html for more information.

  • What is the label thing? – cfischer Nov 22 '13 at 11:44

Worked great to solve the Mavericks bluetooth always discoverable nightmare using the following script:


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .