Open nixpulvis opened 6 years ago
First pass implementation merged in #51.
Key issue we need to fix is related to the scope of variables and their assignment, e.g X=1 echo $X
should not print 1 as it does today.
Captured in a few preliminary tests here; https://github.com/nixpulvis/oursh/blob/b064528c596aa80046a407ac77b3e4cab3f6c0b3/tests/posix.rs#L125-L128
POSIX shell scripts like most programs have a notion of bindings with scope. We need to implement the syntax fo assigning (
FOO=1
) and referencing ($FOO
) variables. As part of loading a program it's default environment should be loaded appropriately. The environment variable$ENV
denotes the complete working environment for a POSIX program.Related to #43.