r0ller/alice — Issue #1: Environment variables are not transferred to forthcoming commands
Author: r0ller
Created: 2011-10-21 12:54:47+00:00
State: open

This happens because each human command translated to a shell script gets executed in a child process. So environment variables set in the shell script are specific to that child process environment and there is no way for a child process to set environment variables in its parent process environment so that later on they get inherited in the forthcoming child process.

The solution is that environment variables occuring in a shell script are read/stored in the parent process during translation using getenv() and putenv(). This way, the environment variables are inherited by the child processes and can be used as a communication channel between subsequent commands.