2

For the record, I am running ZSH, FISH and GNU Bash on my system. I've checked every imaginable location and I cannot find where my $PATH variable is set:

$ echo $PATH
/usr/local/bin /usr/sbin **/Users/bobbi/opt/GNAT/2020/bin /usr/local/CrossPack-AVR/bin** /usr/bin /bin /sbin

I've checked the following files and directories and probably others:

/etc/paths /etc/profile ~/.profile /etc/environment /etc/profile  ~/.bash_login ~/.bash_profile ~/.bashrc

I went through all of the path files and either deleted them or removed any lines where the path is set with the exception of /etc/paths

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

I've read every post and I can't find a solution. I also tried running several which spits different results:

$/usr/libexec/path_helper
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/bobbi/opt/GNAT/2020/bin:/usr/local/CrossPack-AVR/bin"; export PATH;

$ env -i bash -c 'echo $PATH'
/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.

I also did a grep and found this odd bit :

sh-3.2$ grep -rF --binary-files=without-match '/usr/local/CrossPack-AVR/bin' / 2> /dev/null
/usr/local/CrossPack-AVR-20131216/etc/templates/TemplateProject/TemplateProject.xcodeproj/project.pbxproj:              PATH = "$(PATH):/usr/local/CrossPack-AVR/bin";

I even quit the terminal and restarted several times thinking it might be living in memory somewhere. Is there a script I can run where it will tell me exactly what file is responsible for setting the file?

1
  • 1
    It looks like you found the /usr/local/Cross.... file. Any particular value in the $PATH you are trying to chase?
    – mtk
    Commented Jan 27, 2022 at 4:42

1 Answer 1

0

Apparently, Xcode assigns its toolchain paths to the PATH variable. There are several places where Xcode modifies the path. The details are described in the following answer dated 10/22/20:

https://stackoverflow.com/a/64478215/148298

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .