Closed Naji-k closed 1 year ago
it should looking for $var and create new variable called hey=naji
, so the export would be like this
var=hey
hey=naji
There is a function that maybe could help you called
t_env *find_env_by_key(t_env **env_list, char *key);
it will return a node with a key=value from env_list
export $USER
works and adds a new key to the env (key=nakanoun, value=null)
BUT
export $USER=NAAJ
doesn't work
Lexer: {export} | Type: {1} | Index: {0}
Lexer: {$USER=NAAJ} | Type: {1} | Index: {1}
Looking to expand: $USER=NAAJ
$USER=NAAJ not in env, deleting node
it should expand the value of $USER, to add new node to env as (key=expanded$USER, value=NAAJ)
test case: try export var=hey echo $var => hey "CORRECT" but export $var=naji =>
Looking to expand: $var=naji $var=naji not in env, deleting node