Skip to main content
Post Closed as "Duplicate" by mmmmmm macos
edited body
Source Link
jksoegaard
  • 79.6k
  • 4
  • 133
  • 204

My plist has below keys:

<key>StandardOutPath</key>
<string>$HOME/launchd.stdout.log</string>
<key>StandardErrorPath</key>
<string>SHOME<string>$HOME/launchd.stderr.log</string>

But it doesn't identify $HOME. What I want is to load this plist in different user accounts as I cant hardcode my user name.

How can I achieve this ultimate aim?

My plist has below keys:

<key>StandardOutPath</key>
<string>$HOME/launchd.stdout.log</string>
<key>StandardErrorPath</key>
<string>SHOME/launchd.stderr.log</string>

But it doesn't identify $HOME. What I want is to load this plist in different user accounts as I cant hardcode my user name.

How can I achieve this ultimate aim?

My plist has below keys:

<key>StandardOutPath</key>
<string>$HOME/launchd.stdout.log</string>
<key>StandardErrorPath</key>
<string>$HOME/launchd.stderr.log</string>

But it doesn't identify $HOME. What I want is to load this plist in different user accounts as I cant hardcode my user name.

How can I achieve this ultimate aim?

Post Reopened by Monomeeth macos
Added tags. Minor edits. Clarified question.
Source Link
Monomeeth
  • 65k
  • 14
  • 152
  • 190

My plist has below keys:

<key>StandardOutPath</key>
<string>$HOME/launchd.stdout.log</string>
<key>StandardErrorPath</key>
<string>SHOME/launchd.stderr.log</string>

But it doesntdoesn't identify $HOME, i $HOME. What I want is to load this plist in different user accounts, i as I cant hardcode my user name.

How can I achieve this ultimate aim?

My plist has below keys

<key>StandardOutPath</key>
<string>$HOME/launchd.stdout.log</string>
<key>StandardErrorPath</key>
<string>SHOME/launchd.stderr.log</string>

But it doesnt identify $HOME, i want to load this plist in different user accounts, i cant hardcode my user name

My plist has below keys:

<key>StandardOutPath</key>
<string>$HOME/launchd.stdout.log</string>
<key>StandardErrorPath</key>
<string>SHOME/launchd.stderr.log</string>

But it doesn't identify $HOME. What I want is to load this plist in different user accounts as I cant hardcode my user name.

How can I achieve this ultimate aim?

deleted 482 characters in body; edited title
Source Link
MacDeveloper
  • 526
  • 1
  • 7
  • 18

How can I use $HOME or ~/ in my log paths of launchd plist to run as LaunchAgent

My plist is ashas below keys

<?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>StandardOutPath</key>
    <string>me<string>$HOME/launchd.mpietzstdout.MountDevRoot<log</string>
    <key>ProgramArguments<<key>StandardErrorPath</key>
    <array>
        <string>/bin/sh</string>

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

        <!-- Instead of using..launchd.
        <string>/Users/mpietz/bin/attach-devrootstderr.sh</string -->
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
<log</plist>string>

But it is not abledoesnt identify $HOME, i want to pick $HOMEload this plist in different user accounts, throwing no such file or directory

Is there a way I can get home directory without hardcoding iti cant hardcode my user name

How can I use $HOME or ~/ in my launchd plist to run as LaunchAgent

My plist is as below

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

But it is not able to pick $HOME, throwing no such file or directory

Is there a way I can get home directory without hardcoding it

How can I use $HOME or ~/ in my log paths of launchd plist to run as LaunchAgent

My plist has below keys

<key>StandardOutPath</key>
<string>$HOME/launchd.stdout.log</string>
<key>StandardErrorPath</key>
<string>SHOME/launchd.stderr.log</string>

But it doesnt identify $HOME, i want to load this plist in different user accounts, i cant hardcode my user name

Post Closed as "Duplicate" by nohillside macos
Source Link
MacDeveloper
  • 526
  • 1
  • 7
  • 18
Loading