×

INDI Library v1.8.0 is Released (27 Jul 2019)

INDI Library v1.8.0 is mostly a maintenance release to fix a few bugs in several drivers.

Issue with indi_eval

  • Posts: 102
  • Thank you received: 8

Issue with indi_eval was created by Christian

Hi all,

I try to write a script that do a complete shutdown of my observatory. I use indi_getprop, indi_setprop and indi_eval for doing some action before the shutdown.

when i use indi_eval like this :
indi_eval -t 0 -w '"CCD Simulator.CCD_EXPOSURE._STATE"==1'
it do the job either in command line or in a shell script.

But, if i want use the same command with variable like this :

export INDI_CCD="CCD Simulator"
indi_eval -t 0 -wv '"$INDI_CCD.CCD_EXPOSURE._STATE"==1'

Compiling: "$INDI_CCD.CCD_EXPOSURE._STATE"==1
Connected to localhost on port 7624
sending getProperties for $INDI_CCD


it doesn't work because it cannot resolve the INDI_CCD variable. The problem is du to the single quote. I don't know how to resolve this issue.

Does some people have ever had this issue and how to correct it ?
C8 lightbridge, Orion Atlas mount, EOS 1000D modified and ASI120MM for guiding.
3 months 1 week ago #38824

Please Log in or Create an account to join the conversation.

  • Posts: 159
  • Karma: 2
  • Thank you received: 79

Replied by pch on topic Issue with indi_eval

Yes, quoting variable in shell can be tricky.
Other can have better idea, but for me this work. Please note the unclose " in the export command, it is closed in the indi_eval command.
export INDI_CCD='"CCD Simulator'
indi_eval -t 0 -w  "$INDI_CCD"'.CCD_EXPOSURE._STATE"==1'
The following user(s) said Thank You: Christian
3 months 1 week ago #38846

Please Log in or Create an account to join the conversation.

  • Posts: 102
  • Thank you received: 8

Replied by Christian on topic Issue with indi_eval

thank you Patrick. With your advises i finished my script and yes, the bash variables are tricky to manipulate.
C8 lightbridge, Orion Atlas mount, EOS 1000D modified and ASI120MM for guiding.
3 months 1 week ago #38853

Please Log in or Create an account to join the conversation.

Time to create page: 0.468 seconds