Page 1 of 1

Expanding EnvVars

Posted: 20 Nov 2023 10:18
by MBaas
I am currently reorganizing some old scripts of mine which build a menu for popupnested. "Suddenly" I now have a problem with environment variables in that menu not being expanded (they still show as %var%).
Unfortunately I don't have much right now time to dig into this and built a repro, so I thought for a quick fix I could just do set $MyMenu,$MyMenu,r and that indeed expanded those variables - but also and <crlf>s I had embedded in script command, so the whole thing became unuseable!

Do I have to postpone fixes until I have time (possibly next week) or this there perhaps a way to just expand the environment variables (like an undocumented "e" option for set)...

Re: Expanding EnvVars

Posted: 20 Nov 2023 10:27
by highend
Replace <crlf> with e.g. the pilcrow char and then do the set / eval() (and afterwards replace it again)?

Re: Expanding EnvVars

Posted: 20 Nov 2023 10:54
by admin
Posting your code would help.