Created
July 15, 2017 22:21
-
-
Save kcking/86c0d887da27f76c329f1145a85b4da8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rm /tmp/launchctl_env.log 2> /dev/null | |
cat > ~/Library/LaunchAgents/dump_env.plist <<EOF | |
<?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>dump_env</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>env</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>StandardOutPath</key> | |
<string>/tmp/launchctl_env.log</string> | |
</dict> | |
</plist> | |
EOF | |
launchctl load ~/Library/LaunchAgents/dump_env.plist | |
sleep 1 | |
cat /tmp/launchctl_env.log | |
launchctl unload ~/Library/LaunchAgents/dump_env.plist | |
rm ~/Library/LaunchAgents/dump_env.plist | |
rm /tmp/launchctl_env.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment