Greetings to All,

I am writing a custom script where for convenience I store modbus register 
names/index in /etc/environment.
It seems that my machinekit does not recognize /etc/environment variables 
while executing my custom M177 bash script.

I concocted the following debug script:

[M177]
#!/bin/bash
echo $(echo -n $(whoami) && echo -n "  " &&  printenv | grep MY_MODBUS_REG 
| wc -l) >> /home/machinekit_env_vars_debug.txt


Where when I execute it from a terminal, I get :
machinekit  23

And when I execute it from linuxcnc [cnc.mdi('M177')], I get:
machinekit 0

I am aware that when a cmd is executed as Sudo, it does not recognize 
/etc/environment vars as in "sudo printenv | grep MY_MODBUS_REG | wc -l" 
returns 0, but I did not see any sudo in my machinekit starting scripts.


Do I really have to "hard code" my values to my different scripts or is 
someone kind enough to share the Secret?

Much Thanks,

Marc

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to