|
Demo
Discussion
|
Forum
Config Examples
Contributions
Vulnerabilities
|
Discussion forum about ELOG |
Not logged in |
|
|
Message ID: 1555
Entry time: Tue Dec 20 09:18:19 2005
|
|
Category: |
Info |
OS: |
|
ELOG Version: |
SVN 1579 |
|
Subject: |
Shell substitution, especially interesting for running online experiments |
|
|
Shell substitution has been introduced in an experimental state of the current SVN version of ELOG. It woks such that the subsititution list can contain $shell(<argument>) commands. The <argument> is passed to the shell of the operating system and the result is captured and subsituted. This is handy for online experiments, where one wants to pass information automatically to elog. Assume that there is a file /tmp/runnumber containing the current run number of the experiment. All one needs to put the current run number in an attribute "Run number" is the following line in the configuration file:
Preset Run number = $shell(cat /tmp/runnumber)
This subsitution works also for the main text body. Following option will put a calendar of the current month into the text body:
Preset text = $shell(cal)
note that shell subsitution works both on Windows and Unix, the "cat" and "cal" commands are however only present under Unix, but "cat" can be replaced with its Windows counterpart "type". |