minishell
minishell copied to clipboard
[QUESTION] Is `+=` part of the subject?
This matters for both export and for local variable assignment.
If a += is specified instead of an = in shell variable assignments or in arguments to export, the previous value (if it existed) should not be replaced with the new value.
Instead, the new value should be appended to the old value.
In the context where an assignment statement is assigning a value to a shell variable or array index (see Arrays), the ‘+=’ operator can be used to append to or add to the variable’s previous value.
It should not be too difficult to add this feature, but ofc it touches almost everything, starting from the Lexer and going all the way to the final_cmd_table and export.
I think that it actually is, at least for export.
The Subject:
Your shell must implement the following builtins:
- export with no options
+= is not an option to export, it is part of the normal arguments.
But I dont want to implement all of features XD I dont think it is worth to investment the time and I wont fail anyone with this