Is there a was to use variables (environment variables, for example) in actions?
I have to connect to various different clients that provide me different userids. I'd like to be able to set an environment variable,
export X3270USER=MYID
then use that variable in a keymap or hosts file connection String() action,
String("PROFILE PREFIX("$X3270USER")")
or something like that.
One way I did find to get what I need in a keymap is to use the -xrm option.
x3270 -xrm 'x3270.keymap.CLIENTA: #override Alt<key>U: String("PROFILE PREFIX(MYID)")' -xrm 'x3270.keymap: CLIENTA' clienta.com</key>
A bit kludgy I think.
Support for this was added a week or two back. It's not in a tagged release, but if you build from the head of the master branch, you will get it.
The way it works is adding an option to the String() action, "-subst". If "-subst" is given, then environment variables in the other argument(s) are substituted. The variables use Unix shell syntax, e.g.:
String(-subst, "login ${USER}"
This feature will be included in x3270 4.2.
That's great!
I thought I had the most current code, but I don't see this and my build is not recognizing "-subst" as anything special. Not a git pro, however. Was it committed?
Oops, yes, it was committed, but I hadn't pushed it to Sourceforge and Githib. It should be there now.
Thanks, work like a champ.