Reputation: 103
I have a shell script user.sh that calls an ant script. The ant script prompts for some user input like
<input message="Enter the username" addproperty="my.user" />
I want to set an environment variable USER for the script user.sh from the ant script with the input value entered. I tried to do it like this:
<property environment = env />
<property name = env.USER value=my.user />
But it is not setting the environment variable in the shell script. How to set it in the parent shell script which was used to invoke the ant script?
Upvotes: 1
Views: 911
Reputation: 18459
In your case, ant
is sub process of shell. It is not possible to set parent process shell's environment variable from sub process. Other options are .
Upvotes: 2