Home » Developing U++ » U++ Developers corner » Different getenv("PATH") and $PATH on macos M1 (for libclang.dylib)
Re: Different getenv("PATH") and $PATH on macos [message #59491 is a reply to message #59487] |
Thu, 05 January 2023 18:47   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
fudadmin wrote on Wed, 04 January 2023 23:43Novo wrote on Thu, 05 January 2023 01:23Relevant information: How to set PATH for Finder-launched applications
I had seen that link before I posted but I could not to digest. That's why I posted here. It is not about setting the PATH. It is about getting the PATH. We are not going to ask every theide user to set "sudo launchctl config user path", aren't we? Moreover, the PATH is set. I can get it on terminal with 'echo $PATH' without problems. The questions is - how to get it programatically with upp the right way. getenv used inside ide is the wrong way.
P.S. for some reasons this doesn't work:
String path = Sys("echo $PATH");
//gives path="$PATH";
echo is excluded...
More info on this https://stackoverflow.com/questions/36326868/getting-environ ment-variable-path-in-linux-using-c-in-eclipse
It was supposed to be a hint.
Macos doesn't seem to run a login shell when you log into an account. This is why PATH is not set.
If you check Macos Terminal settings you'll find "on launch" setting. By default it runs a login shell.
Basically, you log into system each time you launch a terminal 
Related info:
man opendirectoryd
Open Directory forms the foundation of how Mac OS X accesses all authoritative configuration information
(users, groups, mounts, managed desktop data, etc.). This allows use of virtually any directory system
via Apple and third party modules.
PATH shouldn't be used with Macos GUI apps, IMHO.
Regards,
Novo
|
|
|
 |
|
Different getenv("PATH") and $PATH on macos M1 (for libclang.dylib)
By: fudadmin on Wed, 04 January 2023 04:36
|
 |
|
Re: Different getenv("PATH") and $PATH on macos
By: Novo on Thu, 05 January 2023 02:23
|
 |
|
Re: Different getenv("PATH") and $PATH on macos
By: fudadmin on Thu, 05 January 2023 05:43
|
 |
|
Re: Different getenv("PATH") and $PATH on macos
By: fudadmin on Thu, 05 January 2023 07:03
|
 |
|
Re: Different getenv("PATH") and $PATH on macos
By: Oblivion on Thu, 05 January 2023 16:37
|
 |
|
Re: Different getenv("PATH") and $PATH on macos
By: fudadmin on Thu, 05 January 2023 23:37
|
 |
|
Re: Different getenv("PATH") and $PATH on macos
By: Novo on Thu, 05 January 2023 18:47
|
 |
|
Re: Different getenv("PATH") and $PATH on macos
By: fudadmin on Fri, 06 January 2023 00:05
|
 |
|
Re: Different getenv("PATH") and $PATH on macos
By: Novo on Fri, 06 January 2023 06:06
|
 |
|
Re: Different getenv("PATH") and $PATH on macos
By: fudadmin on Fri, 06 January 2023 09:47
|
 |
|
Re: Different getenv("PATH") and $PATH on macos
By: Novo on Tue, 10 January 2023 16:43
|
Goto Forum:
Current Time: Tue Apr 29 17:40:22 CEST 2025
Total time taken to generate the page: 0.00877 seconds
|