# How do I overwrite Jenkins PATH correctly?

**URL:** <https://community.jenkins.io/t/how-do-i-overwrite-jenkins-path-correctly/25974>\
**Category:** Using Jenkins\
**Created:** [January 21, 2025, 9:52am UTC](https://community.jenkins.io/t/how-do-i-overwrite-jenkins-path-correctly/25974 "2025-01-21T09:52:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cheerbuzz](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@cheerbuzz](https://community.jenkins.io/u/cheerbuzz)\
**Post date:** [January 21, 2025, 9:52am UTC](https://community.jenkins.io/t/how-do-i-overwrite-jenkins-path-correctly/25974/1 "2025-01-21T09:52:11Z")

</div>

Hello, my PATH doesn’t set correctly in my OSX controller node in jenkins. How

In the zsh shell terminal when I output echo $PATH i get something like:

```auto
/Users/user.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/bin:/bin:/usr/sbin

```

Note that rbenv is the first entry and this is important so that jobs dont use the default mac install of ruby and thats how i setup my .zshrc file

However in a jenkins job when i output echo $PATH i get:

```auto
/usr/bin:/usr/local/bin:/opt/homebrew/bin/:/usr/bin:/usr/local/bin:/opt/homebrew/bin/:/Users/test

```

Note that the path is entirely different and there is a “Users/test” path. This path gets appended when i edit the homebrew jenkins.mxcl.jenkins-lts.plist file to have this entry:

```auto
	<key>EnvironmentVariables</key>
        <dict>
		<key>PATH</key>
                <string>/Users/test</string>
        </dict>

```

I need to prepend my path so that my jobs function properly, how do i do this?  
I tried setting Path and PATH as system env variables with no luck either

Jenkins version: Jenkins 2.479.3

---

<div class="post-metadata">

**Author:** ![cheerbuzz](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@cheerbuzz](https://community.jenkins.io/u/cheerbuzz)\
**Post date:** [January 21, 2025, 10:01am UTC](https://community.jenkins.io/t/how-do-i-overwrite-jenkins-path-correctly/25974/2 "2025-01-21T10:01:43Z")

</div>

I think i solved it. I forgot that i had a (wrong) PATH configuration in the Agent configuration. So many places where this can go wrong wow
