Merry, a POSIX shell, received six fixes this week that make quoting, arithmetic, and signal handling behave as the standard requires. A separate change also reduces the time scripts take to run.
Fixes
-
Quoting: Double-quoted strings now unescape
\"and\\correctly, so scripts that embed literal quotes or backslashes inside double quotes produce the expected output. This matches the behaviour ofshand other POSIX shells. 77c2b3d8 -
Pipes: Each stage of a pipeline now closes its read end, so long-running scripts no longer accumulate unused file descriptors. This prevents hitting system file-descriptor limits in scripts that open many pipelines. e640f4ad
-
Arithmetic: Expressions inside
$((...))are now parsed correctly, and when one fails the error message includes the line and column number. This makes it straightforward to locate a typo in a complex arithmetic expression. 17b2f1b7 -
Signal and trap handling: Trap handlers now queue their actions and run them at defined poll points, so signals that arrive during a script are no longer silently dropped. Merry also recognises
SIGPIPE(the signal sent when a pipe's reader closes) and passes the correct context toEXIThandlers, so cleanup code runs with the right environment. 605a9466 f18ac7c7 -
Subshells: Running
execinside a subshell now spawns a child process rather than replacing the shell. The parent script continues after the subshell finishes instead of being terminated. c0115a10