Merry's msh shell now supports loop control with break and continue, and the exec command for replacing the shell process. Several bugs in whitespace handling, variable scoping, and command lookup have also been fixed.
Features
-
Loop control: break and continue now work inside for, while, and until loops, and accept an optional argument to target a specific nesting level. This lets a script exit an inner loop without aborting the outer one.
-
Exec support: exec now replaces the shell process with the named command and its arguments instead of printing an error. This is useful at the end of a script where you want the final command to become the running process.
Fixes
-
Echo whitespace: echo no longer trims leading and trailing spaces from its arguments. A command like echo " hello " now prints the spaces exactly as typed.
-
Eval word joining: eval now joins its arguments with a single space rather than concatenating them directly. This prevents eval echo hello world from producing helloworld instead of "hello world".
-
Pipeline variable scoping: variables set inside a pipeline are removed from the environment once the pipeline finishes. This matches POSIX behaviour and stops a variable from leaking into the parent shell.
-
Command lookup: command resolution now behaves the same way whether you use exec, type, or the dot-source command to find a program. A command that type reports as found will also be found by exec, reducing spurious "command not found" errors.