Comments (3)
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.
"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.
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)
- Running cursor doesn't show HOT 1
- File `test/script/runScript.praat` should be renamed to `test/script/runScript_GUI_.praat` HOT 1
- [Linux musl] melder/melder_real.h: build fails in GCC 12 with "numeric_limits is not a member of std' HOT 3
- sys/praat.cpp - praat_cleanUpName - Why replacing ` ` and `.` characters by underscores? HOT 3
- Unterminated ifs and loops execute instead of throwing syntax error HOT 7
- autosave and version control HOT 1
- Allow refreshing the list of audio devices
- `Record Sound (fixed time)` cannot select USB input
- Compilation of praat.cpp fails on i386 with g++ 13 HOT 5
- Unable to find License information in the repository or via github interface
- Failing test on Windows because of mismatched path separator HOT 1
- Wrong output for "Create SpeechSynthesizer" in Praat 6.3.15 HOT 2
- Add license file to the repository HOT 2
- Extraneous files in 6.3.17 tarball HOT 4
- [feature request] please support save sound to disk as mp3 (in Menu: View & Edit>FIle>Save sound to disk) HOT 2
- Version 6.3.18 failing to build from source on i386 architecture HOT 11
- Allow selection of a boundary without clicking on it exactly
- boolean in beginPause bug
- [feature request] please support reading m4a audio format HOT 1
- number# doesn't work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from praat.