Skip to main content
Solved

Appending to users PATH variable.


Forum|alt.badge.img+3

Hi All

Just looking for some guidance on the above. I have an application that I have packaged but it requires the users $PATH variable to be edited. Just wondering how to go about doing this. I don't want to export my packaging machines .profile and add it to the package for the users machines, as they might have variables written from other installations and I don't want to overwrite them.

So want to see if there is anything in the JSS that can possibly push out variables? We use DMG's in our environment so cannot run a post install script to add it. The users also want to use the application through command line from Terminal so I cannot even write a launcher.app to write the variable then launch the application.

So, does anyone have any ideas on how to handle user variables?

Thanks, Jim

Best answer by cvgs

Have a look at /etc/paths.d/, that should be all you need:

ls -l /etc/paths.d/ -rw-r--r-- 1 root wheel 107 7 Feb 22:49 com.apple.server
cat /etc/paths.d/com.apple.server /Applications/Server.app/Contents/ServerRoot/usr/bin /Applications/Server.app/Contents/ServerRoot/usr/sbin
View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+9
  • Contributor
  • 76 replies
  • Answer
  • May 10, 2013

Have a look at /etc/paths.d/, that should be all you need:

ls -l /etc/paths.d/ -rw-r--r-- 1 root wheel 107 7 Feb 22:49 com.apple.server
cat /etc/paths.d/com.apple.server /Applications/Server.app/Contents/ServerRoot/usr/bin /Applications/Server.app/Contents/ServerRoot/usr/sbin

Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 3 replies
  • May 10, 2013

Thanks a million, thats helped.


donmontalvo
Forum|alt.badge.img+36
  • Legendary Contributor
  • 4293 replies
  • May 10, 2013

What about:

$ cat /etc/paths
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/path_helper.8.html

Don


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings