Recent commits to Merry, a shell, add case statements, while and until loops, and arithmetic expressions, covering the core control-flow and computation needs of shell scripting. The interactive shell also gains prefix-based history recall, and two built-in commands receive correctness fixes.
Features
-
Case statements: Merry can now run case compound commands, matching a value against a list of patterns and executing the first matching branch. This lets scripts branch on variable values without a chain of if/else tests. See 8876f628.
-
While and until loops: Merry supports while and until loops, repeating a block of commands while (or until) a condition holds. Scripts can now iterate over data or wait for a state change without calling an external tool. See 8bf5f9ff and 4e923ed3.
-
Arithmetic expressions: Merry evaluates arithmetic expressions with standard operators, comparisons, and hex or octal literals. Nested sub-expressions are supported, but the double-left-paren form is not. See 86ab5754.
-
Interactive history recall: The interactive shell offers prefix-based history recall and drops duplicate entries, so you can retype a previous command by typing its first few characters. See f5dea97e and cd9ec950.
Fixes
-
Command built-in: The command built-in now runs ordinary shell built-ins (for example, command pwd) instead of only external programs. Scripts that relied on command to invoke a built-in will now work as expected. See 236b7b12.
-
CD error handling: Changing directory to a non-directory now fails with a clear error message instead of silently succeeding. Scripts that check the exit status of cd will now correctly detect a failed directory change. See f6bce395.