Shell Environment Variables/en
Inhaltsverzeichnis
Shell Environment Variables[Bearbeiten]
A number of shell environment variables are used (if present) by expecco and/or the underlying Smalltalk runtime system. Their existance is not a prerequisite to run expecco: default values will be used, if those variables are not present.
Temporary Files Folder[Bearbeiten]
Expecco (and Smalltalk) may create temporary files, which could outlive your sessio In normal operation, temp files are removed when expecco is terminated. However, in case of an abnormal termination (or in case a suite fails to cleanup temporary files correctly), files may be left in your file system.
By default, temporary files are created inside a per-session temporary folder.
This per-session temporary folder is named "stx_tmp_xxxx
" (where xxxx is a session/process-ID) and is created in the tempdir folder.
The tempdir folder is specified by any of: STX_TMPDIR
, TMP_DIR
, TEMP_DIR
, TMPDIR
or TEMPDIR
,
whichever is found in the shell environment.
If none of the above is found in the shell environment, "/tmp
" is used as tempdir.
All per-session temporary files are created in this one temporary folder, to make it easier to cleanup leftover session files.
Actually, if no expecco/Smalltalk is running, all temporary file folders named "stx_tmp_xxx
" can be removed without danger (although temp-file cleanup is typically done automatically by the operating system in regular intervals)
The name of the temporary folder can be retrieved by evaluating and printing:
Filename tempDirectory
(doing a "printIt" in a Smalltalk workspace), or via a corresponding action block in the standardlibrary.
It is good practice, to look at the temp folder from time to time, and remove old leftover files, to prevent your drive to become full (many unix/linux systems do this automatically if configured so).
Script Interpreters for External Language Scripts[Bearbeiten]
If no script interpreter was defined in the settings dialog, fallbacks can be provided by the following shell variables:
- CMD_SHELL (batch scripts; defaults to "
cmd
") - SHELL (shell commands and shell scripts; defaults to "
bash
" or "sh
", whichever is found) - POWERSHELL (powershell scripts; defaults to "
powershell
" or "pwsh
", whichever is found) - RUBY_SHELL (ruby scripts; defaults to "
ruby
") - PYTHON_SHELL (python scripts; defaults to "
python
") - PERL_SHELL (perl scripts; defaults to "
perl
") - TCL_SHELL (tcl scripts; defaults to "
tclsh
") - NODEJS_SHELL (node.js scripts; defaults to "
node
") - GO_SHELL (go scripts; defaults to "
go
") - GNUPLOT_SHELL (gnuplot scripts; defaults to "
gnuplot
") - RSCRIPT_SHELL ('R' scripts; defaults to "
R.exe
" on Windows, "r
" on OSX, "R
" on Unix/Linux)
Referring to Configured Script Interpreters in Shell/Batch Scripts[Bearbeiten]
To refer to whatever language interpreter was configured in expecco from a shell or batch script, the settings are provided as:
- EXPECCO_pythonCommand - the value you gave in the settings for the generic (unspecified) python version
- EXPECCO_python3Command - the value from the settings for explicit version3.x python
- EXPECCO_python2Command - the value from the settings for explicit version2.x python
- EXPECCO_ironPythonCommand -
- EXPECCO_jythonCommand -
- EXPECCO_nodeJSCommand -
The easiest way to find out which values are provided is by executing a shell script consisting of a "printenv" (unix) or "set" (windows) command only, and looking at the value at the "stdout" pin. For example, to make sure that the same interpreter is used when using a shell script for pip-package installation, write a shell script like:
$EXPECCO_python3Command -m pip install %(package)
(notice that the first is a shell variable, which needs a dollar prefix, whereas the second is an expecco value coming from a pin named "package", which needs %(..) around.
For batch/cmd scripts (which need percents around the shell variable's name). use:
%EXPECCO_python3Command% -m pip install %(package)