Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 129 of 807  Not logged in ELOG logo
ID Date Icon Author Author Email Category OS ELOG Version Subjectdown
  68161   Tue Oct 27 11:14:16 2015 Reply kenzo Abrahamskenzoabrahams@gmail.comQuestionLinux3.1.1Re: running more then one shell command when new entries is submitted

The reason why im asking if it can be done using the Execute option is because I need to have the message id of the entry that was submitted and in an external script i dont have access to the variable

kenzo Abrahams wrote:

Hi

Im just curious is it possible to run more then one command using Execute new = <command> or will i have to run a script to run muliple commands.

I tried using '&&' to seperate more then one command but it seems that the first one only gets executed and the rest are just ignored.

Regards

Kenzo

 

  68162   Tue Oct 27 11:19:41 2015 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux3.1.1Re: running more then one shell command when new entries is submitted

The command is passed to your shell, and some shells except more than one command. Most Linux shells accept commands separated by ';', which you can try yourself by entering for example: ls *.c; ls*.h

kenzo Abrahams wrote:

Hi

Im just curious is it possible to run more then one command using Execute new = <command> or will i have to run a script to run muliple commands.

I tried using '&&' to seperate more then one command but it seems that the first one only gets executed and the rest are just ignored.

Regards

Kenzo

 

  68163   Tue Oct 27 11:23:36 2015 Reply kenzo Abrahamskenzoabrahams@gmail.comQuestionLinux3.1.1Re: running more then one shell command when new entries is submitted

If i put the ';' into Execute the rest of the command becomes a comment thats why i was trying to use '&&' instead. If I encapulate the whole command in "" or '' then both commands are executed but the files im trying to write to gets created but no data is piped into it. When I use Execute with one command and pipe its output to a file everything works fine though.

Stefan Ritt wrote:

The command is passed to your shell, and some shells except more than one command. Most Linux shells accept commands separated by ';', which you can try yourself by entering for example: ls *.c; ls*.h

kenzo Abrahams wrote:

Hi

Im just curious is it possible to run more then one command using Execute new = <command> or will i have to run a script to run muliple commands.

I tried using '&&' to seperate more then one command but it seems that the first one only gets executed and the rest are just ignored.

Regards

Kenzo

 

 

  68165   Tue Oct 27 12:20:16 2015 Reply Andreas Luedekeandreas.luedeke@psi.chQuestionLinux3.1.1Re: running more then one shell command when new entries is submitted
As far as I know ELOG is recognising a configuration line as a comment only when it starts with a ';'.
I can assure you that ELOG does not treat the rest of the line as a comment when you use a ';' within a $shell() command: I do it a lot and it works fine. Here's a simple, generic example using the bash:

Preset Author = $shell(if [ $short_name = "Anonym" ] ;then echo $Author;else echo \"$long_name, $Author\";fi)
It adds $long_name to the Author field for non-anonymous entries.

Cheers Andreas

kenzo Abrahams wrote:

If i put the ';' into Execute the rest of the command becomes a comment thats why i was trying to use '&&' instead. If I encapulate the whole command in "" or '' then both commands are executed but the files im trying to write to gets created but no data is piped into it. When I use Execute with one command and pipe its output to a file everything works fine though.

Stefan Ritt wrote:

The command is passed to your shell, and some shells except more than one command. Most Linux shells accept commands separated by ';', which you can try yourself by entering for example: ls *.c; ls*.h

kenzo Abrahams wrote:

Hi

Im just curious is it possible to run more then one command using Execute new = <command> or will i have to run a script to run muliple commands.

I tried using '&&' to seperate more then one command but it seems that the first one only gets executed and the rest are just ignored.

Regards

Kenzo

 

 

 

  68170   Wed Oct 28 11:11:27 2015 Reply kenzo Abrahamskenzoabrahams@gmail.comQuestionLinux3.1.1Re: running more then one shell command when new entries is submitted

Hi Andreas

This worked perfectly thank you.

Andreas Luedeke wrote:
As far as I know ELOG is recognising a configuration line as a comment only when it starts with a ';'.
I can assure you that ELOG does not treat the rest of the line as a comment when you use a ';' within a $shell() command: I do it a lot and it works fine. Here's a simple, generic example using the bash:

Preset Author = $shell(if [ $short_name = "Anonym" ] ;then echo $Author;else echo \"$long_name, $Author\";fi)
It adds $long_name to the Author field for non-anonymous entries.

Cheers Andreas

kenzo Abrahams wrote:

If i put the ';' into Execute the rest of the command becomes a comment thats why i was trying to use '&&' instead. If I encapulate the whole command in "" or '' then both commands are executed but the files im trying to write to gets created but no data is piped into it. When I use Execute with one command and pipe its output to a file everything works fine though.

Stefan Ritt wrote:

The command is passed to your shell, and some shells except more than one command. Most Linux shells accept commands separated by ';', which you can try yourself by entering for example: ls *.c; ls*.h

kenzo Abrahams wrote:

Hi

Im just curious is it possible to run more then one command using Execute new = <command> or will i have to run a script to run muliple commands.

I tried using '&&' to seperate more then one command but it seems that the first one only gets executed and the rest are just ignored.

Regards

Kenzo

 

 

 

 

  1117   Mon May 2 13:27:16 2005 Reply Stefan Rittstefan.ritt@psi.chBug reportLinux2.5.8-6Re: rss feed title & conditional attributes
> When I define 2 attributes, by default and the second one has to be showed
> depending on the first one value the elog correctly handle the thing, but
> the rss feed shows an empty comma separeted field corresponding to the
> conditional attribute not filled ...

Can you send me the part of your config files with those things so that I can
reproduce it?
  1120   Mon May 2 13:34:12 2005 Reply Emiliano GabrielliAlberT@SuperAlberT.itBug reportLinux2.5.8-6Re: rss feed title & conditional attributes
> > When I define 2 attributes, by default and the second one has to be showed
> > depending on the first one value the elog correctly handle the thing, but
> > the rss feed shows an empty comma separeted field corresponding to the
> > conditional attribute not filled ...
> 
> Can you send me the part of your config files with those things so that I can
> reproduce it?

it is attached
Attachment 1: rssbug.cfg
Theme = arco
Comment = ARCO eLogBook
Logfile = /var/log/elog/feedback.log
Logging level = 3
Self register = 3
Restrict edit = 1
Password file = arco.users
Admin user = albert
;no email notification by default
Suppress default = 1
Display mode = threaded
List display = Subject, Type, Author, Date
Thread display = $subject, posted by $author on $entry time
Show attachments = 1
Start page = ?mode=threaded&attach=1
Expand default = 0

Page Title = eLogbook feedback - $subject
Title image URL               = http://ares.roma2.infn.it/ARCO/
Title image                   = <img border=0 src="ARCO_logo.jpg" alt="ARCO logo">
Menu commands = Back, New, Edit, Delete, Reply, Find, Config, Login, Help

Attributes = Author, Type, Category, Subject
Required Attributes = Author, Type, Subject
Options Type = Suggestion{1}, Bug{2}, Other{3}
Show Attributes = Author, Subject, Type

{2}ROptions Category = opened, to be verified, solved
{2}Preset Category = opened

{2}Show Attributes = Author, Subject, Type, Category

; preset author and email
Subst on reply Author = $short_name
Subst on reply Author Email = $user_email
Preset Author = $short_name
Preset Author Email = $user_email
; these attributes cannot be changed
Locked Attributes = Author, Author Email
Fixed Attributes Reply = Subject

Reverse sort = 1
Quick filter = Date, Type
  1124   Mon May 2 14:58:27 2005 Reply Stefan Rittstefan.ritt@psi.chBug reportLinux2.5.8-6Re: rss feed title & conditional attributes
Ok, fixed. I do however not evaluate the conditional attribute, but just remove any
empty attribute, I guess that makes more sense.
ELOG V3.1.5-3fb85fa6