Fixed command substitution behavior in shell expansion:
packages/bare-os-booter/lib/shell.js $(...)/backticks are now enabled by default unless explicitly disabled via BARE_OS_SHELL_CMDSUBST=0|false|off. Fixed sh -c exit/status propagation: packages/bare-os-booter/lib/shell.js Syncs BARE_OS_EXIT_STATUS after each executed statement so later commands in the same line (like echo $?) see the immediately previous status. packages/bare-os-coreutils/src/sh.js In -c mode, reads final BARE_OS_EXIT_STATUS back into ctx.exitCode for consistent result propagation. Implemented trap behavior for requested scope (EXIT, INT, TERM): packages/bare-os-booter/lib/shell.js exit builtin now runs EXIT trap handler before requesting booter exit. packages/bare-os-booter/index.js Signal delivery for shell PID now triggers trap dispatch for INT/TERM. Hardened ulimit -f invalid diagnostics: packages/bare-os-coreutils/src/ulimit.js Explicit invalid-value error for malformed -f setter input, with nonzero exit. Supported-but-unimplemented setter values still return explicit unsupported-setter error.
This commit is contained in:
@@ -150,6 +150,12 @@ async function run(ctx, argv) {
|
||||
}
|
||||
if (args[0] === '-f') {
|
||||
if (args.length > 1) {
|
||||
const raw = String(args[1] ?? '').trim()
|
||||
if (!/^(unlimited|[0-9]+[kKmMgG]?)$/.test(raw)) {
|
||||
ctx.console.error('ulimit: invalid file size: ' + raw)
|
||||
ctx.exitCode = 1
|
||||
return
|
||||
}
|
||||
ctx.console.error('ulimit: setting file size limit is not supported in Bare OS')
|
||||
ctx.exitCode = 1
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user