Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   How to make Subst run?, posted by Robert Heine on Thu Aug 26 15:37:20 2010 
    icon2.gif   Re: How to make Subst run?, posted by Andreas Luedeke on Fri Sep 3 14:14:07 2010 
       icon2.gif   Re: How to make Subst run?, posted by Robert Heine on Mon Sep 6 16:18:41 2010 
Message ID: 66888     Entry time: Fri Sep 3 14:14:07 2010     In reply to: 66884     Reply to this: 66892
Icon: Reply  Author: Andreas Luedeke  Author Email: andreas.luedeke@psi.ch 
Category: Comment  OS: All  ELOG Version: 2.8.-2312 
Subject: Re: How to make Subst run? 

Robert Heine wrote:
Dear colleagues,
I tried to get an Subst <attrib> = $shell(<command>) to work and put this into a Preset text line, like e.g.:
Attributes = subject, ... 
Options <name> = test{1}, ...  
Subst myvar = $shell(dir) 
{1} Preset subject = Test 
{1} Preset text = $myvar 

Which results in an ELOG-entry having printed "$myvar" in its body instead of the expected substitution. Changing the Subst command to: "Subst myvar = $host" or even to "Subst myvar = Test" also resulted in printing just the string "$myvar" into the submitted Elog-entry. - What am I doing wrong?

What you want to do is done simply by:
{1} Preset text = $shell(dir)
You expect "Subst" to create new variables, but it cannot do this.
"Subst" can overwrite the value of an existing field in an already submitted entry, while
"Preset" allows to prefill an existing entry field and the user may overwrites it before submitting (if it is not "Locked".)
In both cases you can either call a shellscript to create the desired text, or you can use
one of the predefined variables defined in the help pages "ELOG - Syntax of elogd.cfg" for "Subst".

Cheers Andreas
ELOG V3.1.5-3fb85fa6