Git Product home page Git Product logo

Comments (3)

jjatria avatar jjatria commented on June 22, 2024

I can confirm that this is the same in Linux: if run from the GUI, appendInfoLine: environment$("PATH") prints a different string than the PATH available outside. Running that script with Praat from the CLI, the result is the same PATH available to the user who called it.

Where is this change taking place? And is this intentional? If so, why?

from praat.

PaulBoersma avatar PaulBoersma commented on June 22, 2024

"the PATH available outside"? I think there exists no such concept on Unix. Environment variables are local to processes, and they are inherited from parent to child processes. Thus, if a Terminal window has a long PATH variable, and you start up Praat from that Terminal window, Praat will report a long PATH variable (please try). If you do "setenv BLIBLA hkfghdfjg" in one Terminal window, another Terminal will not know about it, because environment variables are not sent to sister processes; this is true even when you start the second Terminal window after creating the environment variable in the first Terminal window, because environment variables are not sent from child to parent processes. The same behavior happens with working directories: they as well stay local within their process (thank God) and are inherited by child processes (thank God). In a Praat script, the command "runSystem" starts up a child process that inherits its environment variables from Praat and also inherits its working directory from Praat, and any setenv or cd that you do inside the system command that you're running stays within that scope (thank God). By contrast, if you start up Praat not from a Terminal window but from the Finder, the PATH variable that you get is inherited from the Finder. Why is that PATH variable different? Because Terminal windows run the .cshrc shell script file when they start up (see man tcsh for a complete list), and the Finder only runs the .login shell script (if it does; I did not test this). My .cshrc, for instance, was modified by the Python installer and therefore contains "set path=(/Library/Frameworks/Python.framework/Versions/2.7/bin $path)". Also, MacPorts did "setenv PATH /opt/local/bin:/opt/local/sbin:$PATH". All of this happens only within .cshrc, and the Finder does not run that at start-up. To move the longer PATH into Praat, you would like to start up Praat with a shell that does read .cshrc, e.g. with "tcsh praat". If you know of programs that do have the longer PATH, please tell me about it (e.g. R, when started from the Finder, has a PATH that doesn't include Python on my Mac).

from praat.

jjatria avatar jjatria commented on June 22, 2024

if a Terminal window has a long PATH variable, and you start up Praat from that Terminal window, Praat will report a long PATH variable (please try)

Yup, that is correct. Thanks for clearing that up.

I guess "[preserving] cross-platform portability" in this case means using executables that are in the system PATH. Which makes sense.

from praat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.