Thicket thicket
cambridge
REPOS 4

W12.2026 · 16–22 MarAll

Merry, a shell implementation, gained function-scoping and return-value support in recent commits, making it easier to port existing sh scripts. Several parser and expansion fixes also bring its behaviour closer to standard sh.

Features

  • Function return values: Merry now supports a return command that exits a function with a specified exit code, matching standard sh behaviour. Scripts can use functions as subroutines that signal success or failure back to the caller. Commit

  • Function-scoped variables: A new local command creates variables visible only within the current function. The implementation is described as a rough approximation and is not part of the POSIX standard, so behaviour may differ from other shells. Commit

  • Debug logging: Merry can now produce debug output at a level chosen by a command-line option. This helps developers trace why a script behaves unexpectedly without modifying the script itself. Commit

Fixes

  • Numeric signal identifiers in trap: The trap command now accepts numeric signal numbers (1, 2, 3, 6, 9, 14, 15) alongside named signals. Scripts that reference signals by number will no longer be silently ignored. Commit

  • Positional-parameter expansion: Field-splitting and the handling of the positional-parameter list now match sh more closely for both quoted and unquoted forms. Scripts that rely on standard expansion of arguments passed to a function will behave as expected. Commit

  • Empty variable assignments: The parser now accepts assignments that set a variable to an empty value. Previously these were rejected, which broke scripts that clear a variable before reassigning it. Commit