W wl Well-Known Member Licensed User Longtime User Apr 15, 2017 #1 Hi, As I'm trying to write a checkpassword B4J application (Linux) my problem now boils down to this very small bash script for which I would need a B4J equivalent. What it does (I thinks is): - when an environment variable AUTHORIZED = 1 then set it equal to 2 - execute a command which fully qualified name was passed as an argument to the script Code: Copy #!/bin/bash CHECKPASSWORD_REPLY_BINARY="$1" [ "$AUTHORIZED" != 1 ] || export AUTHORIZED=2 exec "$1" Can this be coded in B4J ? Thanks ! Note: I guess this question boils down to: how can I set environment variables for a subprocess to be started with jShell ? A workaround might be to start a bash script with jShell that sets the environment variable and then launch the application ? Last edited: Apr 15, 2017
Hi, As I'm trying to write a checkpassword B4J application (Linux) my problem now boils down to this very small bash script for which I would need a B4J equivalent. What it does (I thinks is): - when an environment variable AUTHORIZED = 1 then set it equal to 2 - execute a command which fully qualified name was passed as an argument to the script Code: Copy #!/bin/bash CHECKPASSWORD_REPLY_BINARY="$1" [ "$AUTHORIZED" != 1 ] || export AUTHORIZED=2 exec "$1" Can this be coded in B4J ? Thanks ! Note: I guess this question boils down to: how can I set environment variables for a subprocess to be started with jShell ? A workaround might be to start a bash script with jShell that sets the environment variable and then launch the application ?
Erel B4X founder Staff member Licensed User Longtime User Apr 16, 2017 #2 It will be supported in jShell library that will be included in B4J v5.50. Beta version will be released in a few days. Relevant code: Code: Copy shl.SetEnvironmentVariables(CreateMap("ZZZ": "abc", "YYYY": "213")) Upvote 0
It will be supported in jShell library that will be included in B4J v5.50. Beta version will be released in a few days. Relevant code: Code: Copy shl.SetEnvironmentVariables(CreateMap("ZZZ": "abc", "YYYY": "213"))