×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Issue with indi_eval

  • Posts: 150
  • Thank you received: 15

Issue with indi_eval was created by Picard

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 :
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 ?
4 years 11 months ago #38824

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

  • Posts: 210
  • Thank you received: 104
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: Picard
4 years 11 months ago #38846

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

  • Posts: 150
  • Thank you received: 15

Replied by Picard 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.
4 years 11 months ago #38853

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

Time to create page: 0.233 seconds