小编mat*_*pie的帖子

在启动脚本中使用环境变量

我很好奇是否可以ProgramArguments在 Mac OS X Leopard 上的 luanchd 脚本部分指定环境变量。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>me.mpietz.MountDevRoot</string>
    <key>ProgramArguments</key>
    <array>
        <string>/bin/sh</string>

        <string>$HOME/bin/attach-devroot.sh</string>

        <!-- Instead of using...
        <string>/Users/mpietz/bin/attach-devroot.sh</string -->
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)

mac-osx osx-leopard environment-variables launchd

29
推荐指数
3
解决办法
2万
查看次数