Skip to main content
Answer

Appending to users PATH variable.

  • May 10, 2013
  • 3 replies
  • 53 views

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

3 replies

Forum|alt.badge.img+9
  • Contributor
  • 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
  • May 10, 2013

Thanks a million, thats helped.


donmontalvo
Forum|alt.badge.img+36
  • Hall of Fame
  • 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