Printing a list of environment variables doesn’t work.
[admin@mikroHome] system script> :global y
[admin@mikroHome] system script> :set y “123”
[admin@mikroHome] system script> :environment
[admin@mikroHome] system script>
Trying to debug some scripting and it seems as though my variables are not getting set in 2.9rc4. Running scripts with errors produces no error output in the logs or on screen, nor does it the ‘run’ counter increment. Tried setting up a logging topic for scripting but still nothing.
Sam
nevermind, this one does work. I was missing the print after environment.
Sam
Nope - scripting is actually problematic with global variables.
2.9rc6 and below…
A script can contain:
:log info “Setting global variable…”
:global VAR1
:set VAR1 “This is VAR1”
:log info ("VAR1 = " . $VAR1 )
and the value will print. Then, another script can contain:
:log info ("VAR1 = " . $VAR1 )
and the variable no longer has it’s value. If I check and :environment print then it shows it’s there, but the script cannot read it.
Also - setting global variables in a script cause them to not be globally set. An environment print directly after a script was run will not output the values that were just stored.
I am trying to complete the Dynamic DNS update script for 2.9 and I am not able to store values across scripts … very important : )
Thanks,
Sam
(PS. Submitted to support again)