Repository navigation
just-bash@3.6.1
Patch Changes
-
#590
8386d25Thanks @privatenumber! - Boundawkfield arrays bymaxArrayElements. Assigning toNF, to$N, or to a field throughsub/gsubnow fails withfield count limit exceededbefore allocating, instead of padding the record with millions of empty fields. Splitting a record into fields (input records,$0assignment,sub/gsubon$0) stops at the same limit, so a record with more fields thanmaxArrayElementsnow fails with that error. Rebuilding$0checks the joined size against the string limit first, and a negativeNFis rejected as in gawk. -
#562
3ebd1c2Thanks @Hazzng! - Treat/dev/nullredirects as a discard/EOF device without requiring filesystem device nodes. Output redirects discard data, input redirects return EOF, and read-write redirects support both behaviors. This works on filesystems that cannot initialize/dev, preserves command exit statuses, and prevents append redirects from growing a backing file.This change covers redirect operators only. Commands that access
/dev/nullby path, such ascat,cp, andtest -e, still depend on filesystem entries./dev/stdoutand/dev/stderrretain their existing behavior; stream-device identity and offset handling are separate work. -
#584
8fc1930Thanks @privatenumber! - Supportrg --colorand--, and align heading layout, context match prefixes, glob precedence, explicit-file selection, zero match limits, and error exit codes with ripgrep. Preserve the documented smart-case default and plain text output for all color choices.Correct overlapping-context match prefixes in
grep,egrep, andfgrep, while retaining context prefixes for trailing lines after their-mlimit. Apply ripgrep's combined--glob/--iglobprecedence, validate types inrg --filesmode and malformed--iglobvalues, and accept attached values in combined short flags and leading+in nonnegative numeric values.Honor per-file
-mlimits in line-based count mode forrg,grep,egrep, andfgrep, includingrg --count-matches, which counts every occurrence on the selected matching lines. -
#552
7c39159Thanks @FredAmartey! - Evaluate the index ofX[expr]injqagainst the input, as jq does, so.foo[.bar]and$m[.]look up the right key. The index is read before the base and several keys come out in jq's order.path()anddelfollow the same rule, andxancan index with a column, as insplit(names, '|')[idx]. Filters that leaned on the old reading change too:.items[length-1]now readslengthfrom the input, so use.items[-1]for the last item. -
#439
58d1ecfThanks @trieloff! - bash/sh: start nested shells from the exported environment onlyBash.exec(…, { env, replaceEnv: true })set its variables for commands run directly, but a nestedsh -corbash -cnever saw them, and still saw the constructor's env instead:const bash = new Bash({ env: { SECRET: "leak" } }); await bash.exec("sh", { args: ["-c", "echo [$MARKER]; printenv SECRET"], env: { MARKER: "YES" }, replaceEnv: true, }); // was "[]\nleak\n", now "[YES]\n"
Nested
shandbashnow inherit only exported variables. Per-exec environment values reach them,export -ntakes effect, and exports made in oneexec()no longer affect later calls. Wrappers such asenv,time, andtimeoutuse the active caller's variables and exports, preserving script exports without restoring constructor variables during replacement execution.Startup resets
IFSandOPTINDwhile retaining inherited export attributes.cd -uses the currentOLDPWD: an unset value reports an error, and an empty value succeeds without changing directory. -
#592
ad9039aThanks @privatenumber! - Eachexec()now gets its own copy ofshoptsettings, readonly attributes, and hashed command paths, so changes made by oneexec()no longer carry over to later calls on the sameBashinstance. Nested executions (for example throughtimeor a custom command'sctx.exec) still inherit the calling script's settings. -
#580
f0baa00Thanks @privatenumber! - Preserve prepared output destinations when commands change directories and apply output, read-write (<>), and input-only redirects in source order. Combined redirects to/dev/stdoutand/dev/stderruse the selected stream, input redirects on stdout or stderr leave stdin unchanged, and duplicated read-write destinations retain both stdout and stderr output. -
#521
864dfe5Thanks @Hazzng! - Fixjs-execBuffer encoding defaults, UTF-8 reads, typed-array inputs, character-boundary writes, and range validation. Reduce temporary allocations in byte conversion,tr, andsedwhile preserving execution limits. -
#561
6df20ceThanks @Hazzng! - Report a missing or non-directory parent of an output redirect target the way bash doesOn a filesystem whose
writeFilethrowsENOENTfor a missing parent directory,echo x > /missing/frejected the wholebash.exec()call. Inside a loop, the loop stopped after its first iteration and the script still exited 0. The command now fails alone withbash: /missing/f: No such file or directory(orNot a directory),$?is 1, and the script continues. Numeric-fd redirects such asexec 3> /missing/fprint the same message in place ofcannot open redirect target. Other filesystem errors, such asEROFS, behave as before. -
#401
9ab0e0dThanks @atesgoral! - rg: search an empty piped or redirected stdin instead of the current directoryprintf '' | rg targettreated the empty pipe as absent stdin and recursively searched the current directory. Real ripgrep searches the empty input and exits 1 with no matches. A pipeline stage or an fd-0 redirection (< empty-file, an empty here-doc) now counts as stdin even when empty, including throughcommand rgandexec rg.This applies to every external command: inside a group with its own stdin,
{ cat < empty-file; } < othernow reads EOF instead of falling back toother.rgsearches the current directory for character-device stdin (</dev/null,</dev/zero,</dev/random,</dev/urandom) or closed stdin (<&-), as real ripgrep does. Custom commands continue to receive device descriptor content as an empty string infileDescriptors.